bjaffry 0 Posted February 1, 2020 (edited) Hello, I am trying to create a hotkey button which sells/covers x% of my position, cancels my stop loss order, and sends a new stop loss order for break even and updates new position size. Here is an example of the script that I am using for selling 30% of my position. CXL ALLSYMB;ROUTE=LIMIT;Price=BID-0.05;Price=Round2;Share=Pos*.3;TIF=DAY+;SELL=Send;ROUTE=STOP;StopType=Market;StopPrice=AvgCost;Share=Pos-share;TIF=GTC;SELL=SEND; The issue with this script is when I press the button, it works once. The second time I press it, it doesn't update my position size. Can anyone correct my script or share a script that does the same function? Thank you Edited February 1, 2020 by bjaffry Share this post Link to post Share on other sites
Paul aka Aurbano 83 Posted Thursday at 01:23 PM (edited) hello @bjaffry, that scripts achieve several targets in the process : Deletes all orders for the ticker. Opens a new limit order for 30% of the position @ bid-0.05 (DAY+) Opens a new market stoploss order for the position @ avg price (GTC) I'd check 3 things : Share = Post-share >> are you sure that calculation is right ? TIF ... double check if you need to make them both "DAY" or "GTC". Mouse or focus position. Check if you need to click in your chart before pressing the hotkey. Edited Thursday at 01:24 PM by Paul aka Aurbano check Share this post Link to post Share on other sites