Jump to content

We have moved to Discord. Please click here to join us in the Trading Terminal Discord server.



These forums are read-only.

Leaderboard


Popular Content

Showing content with the highest reputation on 03/23/2023 in Posts

  1. 1 point
    I flipped the script on some hotkeys PeterB posted in another thread. PeterB's original Hotkeys were designed so that you could double-click your StopLoss Price. The Hotkey would calculate the Shares required based on your chosen $Risk, then after entering the position, a TriggerOrder would be sent that would be a Range Exit base on a Risk/Reward ratio of your choosing. In the Hotkey script, you would need to modify some lines depending on your Risk and your Risk/Reward target ratio. I found that I was better at predicting where a Price WOULD go (TakeProfitPrice) instead of where it might NOT go (StopLossPrice). So I modified PeterB's Hotkey script so that instead of double-clicking the StopLoss Price, I double-click my TakeProfit Price. The Hotkey script then calculates the correct number of shares required to achieve the $Profit, enters the position, calculates the StopLoss based on the Risk to Reward ratio I choose, then places a Range Exit order with my double-clicked TakeProfit Price and the calculated StopLoss Price. Here are the scripts for DAS Trader Pro with IB. Even though I've tested these Hotkeys (in SIM), YOU SHOULD TEST THEM IN SIM BEFORE GOING LIVE! Since the script is flipped, it is easy to end up with a StopLoss that is too tight if you aren't careful. Here are the 1:3 Risk/Reward scripts: MARKET LONG RISK $100, double click ProfitTargetPrice, get 1 to 3 RR MARKET Range Exit CXL ALLSYMB; StopPrice=Price+0; DefShare=BP*0.975; Price=Price-Ask+0.00; SShare=300/Price; Share=DefShare-SShare; DefShare=DefShare+SShare; SShare=Share; Sshare=DefShare-SShare; Share=0.5*SShare; TogSShare; ROUTE=SMRTM; TIF=DAY; BUY=Send; DefShare=10; Price=StopPrice-Bid/3; Price=Round2; Price=Ask-Price; TriggerOrder=RT:STOP STOPTYPE:RANGEMKT LowPrice:Price HighPrice:StopPrice ACT:SELL QTY:POS TIF:DAY; MARKET SHORT RISK $100, double click ProfitTargetPrice, get 1 to 3 RR MARKET Range Exit CXL ALLSYMB; StopPrice=Price-0; DefShare=BP*0.975; Price=Bid-Price+0.00; SShare=300/Price; Share=DefShare-SShare; DefShare=DefShare+SShare; SShare=Share; Sshare=DefShare-SShare; Share=0.5*SShare; TogSShare; ROUTE=SMRTM; TIF=DAY; SELL=Send; DefShare=10; Price=Bid-StopPrice/3+Ask; Price=Round2; TriggerOrder=RT:STOP STOPTYPE:RANGEMKT LowPrice:StopPrice HighPrice:Price ACT:BUY QTY:POS TIF:DAY; Here are the 1:1 Risk/Reward scripts: MARKET LONG Risk $100 double click ProfitTargetPrice, get 1 to 1 Risk to Reward MARKET Range Exit CXL ALLSYMB; StopPrice=Price+0; DefShare=BP*0.975; Price=Price-Ask+0.00; SShare=100/Price; Share=DefShare-SShare; DefShare=DefShare+SShare; SShare=Share; Sshare=DefShare-SShare; Share=0.5*SShare; TogSShare; ROUTE=SMRTM; TIF=DAY; BUY=Send; DefShare=10; Price=StopPrice-Bid/1; Price=Round2; Price=Ask-Price; TriggerOrder=RT:STOP STOPTYPE:RANGEMKT LowPrice:Price HighPrice:StopPrice ACT:SELL QTY:POS TIF:DAY; MARKET SHORT RISK $100, double click ProfitTargetPrice, get 1 to 1 Risk to Reward MARKET Range Exit CXL ALLSYMB; StopPrice=Price-0; DefShare=BP*0.975; Price=Bid-Price+0.00; SShare=100/Price; Share=DefShare-SShare; DefShare=DefShare+SShare; SShare=Share; Sshare=DefShare-SShare; Share=0.5*SShare; TogSShare; ROUTE=SMRTM; TIF=DAY; SELL=Send; DefShare=10; Price=Bid-StopPrice/1+Ask; Price=Round2; TriggerOrder=RT:STOP STOPTYPE:RANGEMKT LowPrice:StopPrice HighPrice:Price ACT:BUY QTY:POS TIF:DAY; Here is how you use the scripts: 1. Determine your Risk 2. Determine your Risk/Reward Ratio 3. Change two lines in each Script. The line that says "SShare=???/Price;" and the line that says "Price=Bid-StopPrice/?+Ask;" (or) "Price=StopPrice-Bid/?;" ---- the SShare amount will be your $Risk times the Ratio. For instance, if your Risk is $100 and the Ratio is 1:2, then you would place 200 for the amount. ---- in the Price portion of the script, you will place the number that corresponds with your desired R/R ratio. For example: 1 for 1:1, or 2 for 1:2. 4. Double-Click where you want to take profit 5. Activate the Hotkey. I hope some people find this helpful. Best, Russell Landwehr
  2. 1 point
    Hey guys, I finally did it by myself and tested it the last 2 months (in SIM and then live) and it works pretty well ; here are the scripts : To add 10$ risk LONG : CXL ALLSYMB;StopPrice = Price;Share=Price*100*Pos;Price=AvgCost;SShare=Price*100*Pos;Share=Share-SShare+1000; Price=Share/100;Share=Price;Price=Ask-StopPrice;SShare=Share / Price;DefShare=BP*0.97;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;SShare=DefShare-SShare;Share=0.5*SShare;Price=Ask+0.02;TogSShare;TIF=DAY+;ROUTE=LIMIT;BUY=SEND;DefShare=10; TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+; To ass 10$ risk SHORT : CXL ALLSYMB;StopPrice = Price;Share=-Price*100*Pos;Price=AvgCost;SShare=-Price*100*Pos;Share=Sshare-Share+1000; Price=Share/100;Share=Price;Price= StopPrice-Bid;SShare=Share / Price;DefShare=BP*0.97;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;SShare=DefShare-SShare;Share=0.5*SShare;Price=Bid-0.02;TogSShare;TIF=DAY+;ROUTE=LIMIT;SELL=SEND;DefShare=10; TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice ACT:BUY STOPPRICE:StopPrice QTY:Pos TIF:DAY+; As usual, you have to change the route from LIMIT to SMRTL if you trade with IB, and the risk amount is multiplied by 100 in the hotkey script, so you just have to change the underlined and bold 10. Just one additional important point, it only works when your new stop loss and your new entry are in the direction of your trade, which anyway corresponds to your add strategy. However, if you select a wider stop for your add (which is theoretically impossible if you want to keep the same R amount), it still calculates a nb of shares (because one of the field used in the script automatically transforms negative values in positive ones) I hope it helps. Do not hesitate to reach out if necessary.
[[Template core/front/global/mobileNavigation is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.