b396 Posted October 21, 2022 Report Share Posted October 21, 2022 Please share any HotKey combination in json, it would be immensely helpful to me to learn this amazing platform. I would like to create a hot key for current position cancel all pending orders exit 33% position at 2%, 67% position at 3% stop loss 33% at -1.25%, 67% at -1% also is there a way to cancel all orders on flat position? - I am coming from Sierra Chart so some of my questions come from that Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted October 21, 2022 Report Share Posted October 21, 2022 the 3 bullets you mentioned - I assume you want each one to be a separate hotkey. Cancel all pending orders though can be done with a hotkey, can also be just a simple keyboard shortcut for the Cancel All command Will get the rest do you Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted October 21, 2022 Report Share Posted October 21, 2022 1. Ok this one: "exit 33% position at 2%, 67% position at 3%" - I presume when you say at 2% you mean 2% above what you paid? If so, here is the hotkey (I will just post a screenshot, not JSON - easier for you to change it for your needs) Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted October 21, 2022 Report Share Posted October 21, 2022 and the same thing for "stop loss 33% at -1.25%, 67% at -1% " Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted October 21, 2022 Report Share Posted October 21, 2022 Cancel all pending orders: Quote Link to comment Share on other sites More sharing options...
b396 Posted October 21, 2022 Author Report Share Posted October 21, 2022 (edited) thank you your help I was able to put them in one script and it works with IB paper trading for long side but not for short with message Error: Invalid Quantity. may be it has to do with qty... Would you please check? cancel all and then 33 % AT 2% from PricePaid.Hotkey.txt Edited October 21, 2022 by b396 updated json file Quote Link to comment Share on other sites More sharing options...
b396 Posted October 21, 2022 Author Report Share Posted October 21, 2022 Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted October 21, 2022 Report Share Posted October 21, 2022 instead of doing the Cancel all section in the beginning, it would be better to delete that section and just set the first order "Send" value to be "CancelThenSend". That way MT will try to cancel any orders AND wait for the cancel to actually complete before sending the new orders Quote Link to comment Share on other sites More sharing options...
b396 Posted October 21, 2022 Author Report Share Posted October 21, 2022 script work just fine for long position. but script does not work for short position. I disabled all sections but one ... still for each section it comes back with Error: Invalid Quantity. Quantity is calculated correctly as it shows on the right price level. Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted October 21, 2022 Report Share Posted October 21, 2022 need to use the absolute value of the position. or use PosAbs Quote Link to comment Share on other sites More sharing options...
b396 Posted October 21, 2022 Author Report Share Posted October 21, 2022 thank you solved the problem! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.