junpasion 0 Posted December 5, 2020 Newbie here and this is my first post. I got the code from a Google Doc shared by Aiman. This is a hotkey to place a limit for 0.10 above the average cost: ROUTE=LIMIT;Price=AvgCost+0.10;Share=Pos;TIF=DAY+;SELL=Send; I would like to modify so that it will suit my needs. Kindly confirm or correct these scripts: 1) I would like to place a limit at 5% above the average cost. ROUTE=LIMIT;Price=AvgCost*1.05;Share=Pos;TIF=DAY+;SELL=Send; 2) Or to sell half at 5% above the average cost. ROUTE=LIMIT;Price=AvgCost*1.05;Share=Pos*0.5;TIF=DAY+;SELL=Send; 3) and to go further, sell half at 5% above average plus put an automatic stop loss for the remaining at breakeven. ROUTE=LIMIT;Price=AvgCost*1.05;Share=Pos*0.5;TIF=DAY+;SELL=Send;ROUTE=STOP;StopType=Market;StopPrice=AvgCost;Share=Pos-share;TIF=GTC;SELL=SEND Your confirmation/correction is greatly appreciated. Thanks in advance. Jun Pasion Share this post Link to post Share on other sites
KyleK29 258 Posted December 10, 2020 (edited) Hi Jun, What are you trying to do with these hotkeys? The hotkeys you listed are used for setting take-profit orders for already open positions (AvgCost variable is only available for an open position). Are you using them to set take-profit orders? Side tip: Be sure to keep an Open Orders window viewable on your main trading screen at all times so you can see which orders are in the system and don't end up with duplicate Stop Orders. Edited December 10, 2020 by KyleK29 --------------------------------------------------------- ○ Profile / Project Pages (Dynamic Hotkeys, StreamDeck Files, and other contributions are located here) Share this post Link to post Share on other sites
junpasion 0 Posted December 10, 2020 Hi Kyle, Yes this is when I have a position already. The third one is most important where I want to sell half of my position at 5% above average price, then automatically put a Stop Loss at breakeven. Been trying on DAS SIM, it does xecute the sell at 5% above average price, put the sopt loss at breakeven, but does not execute the sell when it hits the stop loss even it was broken. Share this post Link to post Share on other sites