Abu Danny 0 Posted August 27, 2020 (edited) I am trying to get a hotkey which would sell (lets say a long position) 10 or 25% percent of the open position to lock in some gains but still adjust the Target Range order . Here is what i currently do 1) Enter into a trade with say 2R (that is a hotkey). e.g using a $20 risk . Quote StopPrice=Price-0.01;DefShare=BP*0.97;Price=Ask-Price+0.01;SShare=20/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare;TogSShare;ROUTE=SMRTL;Price= Ask+0.05;TIF=DAY+;BUY=Send;DefShare=400;Price=Ask-StopPrice*2+Ask;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:Pos TIF:DAY+; 2) I want to lock some gain say 10% so i execute the following (yes i know i am canceling existing Trigger order but i cannot find a way to grab/replace it programmatically inline) Quote CXL ALLSYMB;ROUTE=LIMIT;Share=Pos*.1;Price=Bid-.01;TIF=DAY+;SELL=Send; I want my second hotkey to sell the 10% and re-set my targets based on the new remaining shares. However my problem is that Trigger range order is not executing and i cannot debug it . It is technically the command from step 2 and the triggerorder with stop just below the avgcost and X times that risk ( X here is set to 10). Can be adjusted on the chart later. Quote CXL ALLSYMB;ROUTE=LIMIT;Share=Pos*.1;Price=Bid-.01;TIF=DAY+;SELL=Send;Price=Ask-AvgCost*10+Ask;STOPPRICE=AvgCost;StopPrice=Round2;TriggerOrder=RT:STOP STOPTYPE:RANGE LowPrice:StopPrice HighPrice:Price ACT:SELL QTY:Pos*0.90 TIF:DAY+; Edited August 28, 2020 by Abu Danny Share this post Link to post Share on other sites
Abu Danny 0 Posted August 28, 2020 @KyleK29 King Kyle , what do you think ? thanks in advance Share this post Link to post Share on other sites