How can I convert a failed limit order to a market order?
Has anyone written EL code to convert a failed limit order on a range bar into a market order on the following range bar? I am trying to write some order handling instructions that initiate a limit order under certain conditions, however if the order is not filled, I would like the order to go out as a market order on the next bar. Any suggestions are appreciated. Thank you.
So for example, in a long, say you have a stop limit order to buy one GC long at 1000.00. The current price is at 999. The price heads up to 1000.x When the stop is hit when the price gets to 1000.00, your limit order gets placed at, say, 1000.50? Is that the same thing that ye be looking for?
Hrmm, if the limit order is not filled, turn it into a market order...Oh wait, wouldn't that be a "market-if-touched" thingy?
The following user says Thank You to HoopyTrading for this post:
orders in Multicharts remain alive as long as the conditions that triggered the order stay unchanged. As you can't convert the order type it would work along the lines of cancel your limit order and send a market order instead.
The code for the above would depend on the code you have, but in general you'd make sure that the conditions that keep the limit order alive are set back to false at the end of the bar (or at the beginning of the new bar) and instead your code sends a market order at that moment.
I assume the build in feature to convert limit orders to market orders after X seconds can't be used here due to the range bars (and thus you don't know in advance when the bar closes).
The following user says Thank You to ABCTG for this post: