Jump to content

Leaderboard


Popular Content

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

  1. 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.
×
×
  • Create New...

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.