3acor Posted September 23, 2022 Report Share Posted September 23, 2022 Hey,Is there a way to attach a stop order when sending an order using hotkeys?For example, I place a trade on the chart using hotkeys to buy 100 shares.I would like the hotkey to automatically attach a stop loss order of 100 shares that I myself place and send it on the chart. Thanks ! Quote Link to comment Share on other sites More sharing options...
Mike Medved Posted September 23, 2022 Report Share Posted September 23, 2022 If you place the order USING the hotkey, you can place another order (or 10 other orders) in the same hotkey. Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted September 23, 2022 Report Share Posted September 23, 2022 ahmm, to clarify - you would want to have the hotkey place a OTA conditional order, not just 2 orders. for example BUY 100 of XYZ at LIMIT of 20.34 and and OTA (One Triggers Another) SELL 100 of XYZ STOP MARKET of 19.90 Quote Link to comment Share on other sites More sharing options...
3acor Posted September 24, 2022 Author Report Share Posted September 24, 2022 Sorry maybe I didn't clarify properly. I meant that in the hotkey, I place an order to buy 100 shares of XYZ at a limit price of Ask+0.1. What I do after is that I press F3 on the chart, which I set it in a way that when pressing F3, I drop a stop order on the chart which I then chose which price I want. Could it be possible that in the hotkey, on top of sending an order of buying 100 shares of XYZ at a limit price of Ask+0.1, I can attach a stop order(without it being sent, just being dropped on the chart) of 100 shares which I then send it by clicking a price of my desire on the chart, instead of having to press F3? Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted September 24, 2022 Report Share Posted September 24, 2022 Oh sure. here is the code (you can copy/paste it into MT: { "PreHotkey": false, "UniqueID": "UATTPX0RAKYQKTCHYNTDVA==", "ShortDesc": "Limit+drop Stop", "ButtonText": "L+DropStop", "ButtonColor": "147, 255, 153", "LongDesc": "", "Enabled": true, "IsSavedOrder": true, "ActiveWinType": 63, "JSON": { "Command": [ { "Disabled": false, "Order": { "Drop": "false", "Send": "true", "ConditionalType": "None", "Legs": [ { "OrderType": "Limit", "Action": "Buy", "Quantity": "100", "LimitPrice": "Ask+ 0.01" } ] } }, { "Disabled": false, "Order": { "Drop": "true", "Send": "false", "ConditionalType": "None", "Legs": [ { "OrderType": "StopMarket", "Quantity": "100", "Action": "Sell" } ] } } ] }, "LastUpdatedTicks": 0, "NumOrders": 2 } OR Visually it is: 1 1 Quote Link to comment Share on other sites More sharing options...
3acor Posted September 24, 2022 Author Report Share Posted September 24, 2022 Thanks a lot ! I appreciate it Quote Link to comment Share on other sites More sharing options...
3acor Posted January 29 Author Report Share Posted January 29 Is there a way to automatically attach the stop loss order a certain percentage from the current market price and have the stop loss order be above the market price if I am Short and below the market price if I am Long? Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted January 29 Report Share Posted January 29 sure. the action field can be an expression. you can do stuff like Pos<0 ? "Buy" : "Sell" similar stuff for price - can add or subtract the offset from the bid or ask depending on POS being < or > 0. Quote Link to comment Share on other sites More sharing options...
3acor Posted January 29 Author Report Share Posted January 29 Sorry could you tell me what the code in the expression should be? Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted January 29 Report Share Posted January 29 lets say you want the stop order 5 cents above the ask or below the bid depending on direction. you can set it to be Pos < 0 ? Ask + 0.05 : Bid - 0.05 So if you are Short, position will be less than zero, so the stop will be Ask+0.05. if you are Long, position will be greater than zero, so the stop will be Bid-0.05. Quote Link to comment Share on other sites More sharing options...
3acor Posted January 29 Author Report Share Posted January 29 and if I want it in percentage? Is it like Pos < 0 ? Ask + 0.1% : Bid - 0.1% Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted January 29 Report Share Posted January 29 0.1% is not a valid thing. You can just multiply... so Ask*1.001 or Bid * 0.999 1 Quote Link to comment Share on other sites More sharing options...
3acor Posted January 29 Author Report Share Posted January 29 I am getting this Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted January 29 Report Share Posted January 29 use of POS and PosAbs would require for the hotkey to be hit after you are in a position. If you want it to be combined with the entry, you would have to do a OTA order so the logic would be different. The Quantity would be the same for both orders and you would just set the price to be the offset. But in that situation you would know if you are going short or long - would not have to code for it, no? Quote Link to comment Share on other sites More sharing options...
3acor Posted January 29 Author Report Share Posted January 29 oh yes that is true, I missed that. I got it like this and it works. Quote Link to comment Share on other sites More sharing options...
Jerry Medved Posted January 29 Report Share Posted January 29 well, that would be 2 independent orders placed at the same time. What if it never executes the buy? Quote Link to comment Share on other sites More sharing options...
3acor Posted January 29 Author Report Share Posted January 29 (edited) The first order is supposed to be Ask + 0.1 but I was just testing it and didn't want my order to be filled so I put Bid-0.2 Edited January 29 by 3acor 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.