Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
How can I convert a failed limit order to a market order?
Hello,
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.
Can you help answer these questions from other members on NexusFi?
Hrmm. You know, I have seen this, or something like it, in Ninja. It has something similar. It's basically like this...
You set a stop limit order with an offset in ticks on your desired direction.
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?
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).