Justin 254 Posted February 6, 2021 Hmmm hard to say... it does look like it's trying to work The sell of 50% (28 shares) at the current price, the new stop at your average price for the remaining 50% (29 shares).... But the old stop should have cleared. Did you remember to remove the + after DAY in the script? Share this post Link to post Share on other sites
peterB 304 Posted February 6, 2021 (edited) CXL ALLSYMB;ROUTE=LIMIT;Price=BID-0.05;Price=Round2;Share=Pos*.50;TIF=DAY;SELL=Send;ROUTE=STOP;StopType=Market;StopPrice=AvgCost;Share=Pos-share;TIF=DAY;SELL=SEND works for me everyday. so i would suspect you have a syntax error in your actual hotkey. if you test the hotkey on non-shortable stocks, does it work? it should not allow you to place the order as you cnat sell the stock until you do the CXL ALLSYMB before. so test that please Edited February 6, 2021 by peterB Share this post Link to post Share on other sites
evan 16 Posted March 4, 2021 On 2/3/2021 at 4:16 PM, Justin said: You can definitely do a 2:1 range order in the same "part-2" hotkey, but it would be a full exit at the stop loss and 2R. How would you script this? I have a hotkey for manual entry that does this, but I'd love to be able to pre-select my entry price. Share this post Link to post Share on other sites
evan 16 Posted March 4, 2021 On 2/2/2021 at 4:14 PM, Justin said: This will show on the chart (below) as a range order, as the hotkey is set to do a 5 cent range (Price=Price+.05) - you can change this to whatever you're comfortable with. Could I have this trigger a market order instead of a range? In other words, one the selected price is hit, I'm fine getting in at any price. Share this post Link to post Share on other sites
Justin 254 Posted March 4, 2021 12 minutes ago, evan said: Could I have this trigger a market order instead of a range? In other words, one the selected price is hit, I'm fine getting in at any price. Long DefShare=BP*0.97;Price=Price-StopPrice;SShare=20/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare; SShare=Share;Share=Price*100; Price=StopPrice; DefShare=Price*100; Price=Share/100; Price=Price+StopPrice; StopPrice=Price; Share=SShare; TogSShare; Price=Price;TIF=DAY+;Route=Stop;StopType=Market; Buy=Send; Share=DefShare;Price=Share/100; StopPrice=Price; DefShare=400;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;  Short DefShare=BP*0.95;Price=StopPrice-Price;SShare=30/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare; SShare=Share;Share=Price*100; Price=StopPrice; DefShare=Price*100; Price=Share/100; Price=StopPrice-Price; StopPrice=Price; Share=SShare; TogSShare; Price=Price;TIF=DAY+;Route=Stop;StopType=Market; Sell=Send; Share=DefShare;Price=Share/100; StopPrice=Price; DefShare=400;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0 ACT:BUY STOPPRICE:StopPrice QTY:Pos TIF:DAY+;  1 Share this post Link to post Share on other sites
Alxander 0 Posted March 11, 2021 (edited) Hi Justin, This is something i've been looking for. how will this script look for long/short without the calculated risk% but with manually set stop loss? and how will it look like if its for marked order and limit - short/long. I'm not at the level that i can reverse engineer the ones you have provided, sorry! Edited March 11, 2021 by Alxander Share this post Link to post Share on other sites
peterB 304 Posted March 11, 2021 so maybe state exactly what you want to achieve by words and there is a 90% chance that someone has it already prepared for you Share this post Link to post Share on other sites
Justin 254 Posted March 11, 2021 1 hour ago, Alxander said: how will this script look for long/short without the calculated risk% but with manually set stop loss? Like, you just want to set an order in the future to go long for a fixed $, but the stop is a fixed amount... like 20c? Share this post Link to post Share on other sites
Alxander 0 Posted March 11, 2021 (edited) ** Changed it myself - Justin and Kyle, this Script is amazing!! this is something you should learn people to use, this is also great for risk management when you want to catch a break out! ten out of ten!  Sorry Justin, my head is a little slow these days due to the flu. Ignore my first post. Is it possible to change the script to buy a fixed amount of 100 shares? the stop loss is perfect as it is ! My head is just better at handling fixed shares and when i get better i can change the number as i grow as a trader Edited March 12, 2021 by Alxander Share this post Link to post Share on other sites
jeremy.o 0 Posted March 18, 2021 Hi Justin, Great work, I am testing this out myself and I prefer trailing stops instead of a limit stop. Will it be possible to help me adjust the code to a trailing stop? Share this post Link to post Share on other sites
justinstrommer9 18 Posted March 25, 2021 I just started using this and running into an issue. It works in my simulator perfectly, but when I switch to my live account it does not work. I set the stop and then the second hotkey is not sending an order. Any idea why this would be happening?  Do i need to add anything to the hotkey script for it to work in live? Share this post Link to post Share on other sites
peterB 304 Posted March 25, 2021 1. what is your broker? 2. what is your hotkey? Â 1 Share this post Link to post Share on other sites
justinstrommer9 18 Posted March 25, 2021 My broker is interactive brokers. I am using the same exact hotkey script in this post. I have it set to CTRL+1 and CTRL+2 to execute the stop and entry hotkeys.  It works perfect in papertrade mode, but no entry hotkey does not respond when live. Share this post Link to post Share on other sites
justinstrommer9 18 Posted March 25, 2021 this is the LONG ENTRY HOTKEY: DefShare=BP*0.97;Price=Price-StopPrice;SShare=20/Price;Share=DefShare-SShare;DefShare=DefShare+SShare;SShare=Share;Sshare=DefShare-SShare;Share=0.5*SShare; SShare=Share;Share=Price*100; Price=StopPrice; DefShare=Price*100; Price=Share/100; Price=Price+StopPrice; StopPrice=Price; Share=SShare; TogSShare; Price=Price+.05;TIF=DAY+;Route=Stop;StopType=Limit; Buy=Send; Share=DefShare;Price=Share/100; StopPrice=Price; DefShare=400;TriggerOrder=RT:STOP STOPTYPE:MARKET PX:StopPrice-0 ACT:SELL STOPPRICE:StopPrice QTY:Pos TIF:DAY+;  Share this post Link to post Share on other sites
peterB 304 Posted March 26, 2021 (edited) 18 hours ago, justinstrommer9 said: Route=Stop you need to have Route=SMRTL for Interactive brokers edit: sorry i missed that it is for future entry order Edited March 26, 2021 by peterB Share this post Link to post Share on other sites