Hi,
is it possible to send a limit order in a chart as an market order to the broker if the limitorder is filled / touched in the chart?
I don´t want an limit order at my broker that is converted after x seconds to an market order. Instead every limit order should be send
as an market order to my broker.
I tested this with following options:
Autotrading mode is Async, Get Real-Time from Chart is selected, Classic Backtesting is used.
i checked both Convert unexecuted limit ... with 0 Seconds. I hoped that 0 seconds will convert the limit to an market order before the order is send to the broker.
But with this settings i have limit-orders at IB.
Tested with current MC 9 beta 2 and IB.
It such an conversion of orders possible?
Thx Wegi
Autotrading, convert limit orders
- Andrew MultiCharts
- Posts: 1587
- Joined: 11 Oct 2011
- Has thanked: 931 times
- Been thanked: 559 times
Re: Autotrading, convert limit orders
Hello wegi,
Here is the sequence of events that is toggled on/off and controlled by the Unfilled Strategy Order Replacement feature: limit/stop order is sent to broker -> broker returns to MC that the order is placed successfully -> current price touches/crosses the order level -> MC waits for 0 seconds -> MC cancels the order -> broker returns to MC that the order is cancelled successfully -> MC places market order instead of the limit/stop -> broker returns to MC that the order is filled successfully. If you specify 0 seconds, your limit/stop order is replaced with market order immediately, but only after the limit/stop order is placed.
The only solution for you is to monitor price from code and place market order when price reaches the level. You can also draw trendlines on the chart from the same strategy code to visualize the level.
Here is the sequence of events that is toggled on/off and controlled by the Unfilled Strategy Order Replacement feature: limit/stop order is sent to broker -> broker returns to MC that the order is placed successfully -> current price touches/crosses the order level -> MC waits for 0 seconds -> MC cancels the order -> broker returns to MC that the order is cancelled successfully -> MC places market order instead of the limit/stop -> broker returns to MC that the order is filled successfully. If you specify 0 seconds, your limit/stop order is replaced with market order immediately, but only after the limit/stop order is placed.
The only solution for you is to monitor price from code and place market order when price reaches the level. You can also draw trendlines on the chart from the same strategy code to visualize the level.
Re: Autotrading, convert limit orders
First, thanks for your detailed explanation.
I will need some time too test it.
But now i don´t understand why there was 1 pending limit order in the tws last night.
I will take a look at this to find the problem.
And that´s why i want to convert every limit order to an market order at my broker like this:
Limit Order in the Chart pending -> no Order at the Broker.
Limit Order filled in the Chart -> buy/sell at Market at the Broker.
This causes less problems with limit orders at my broker. This is my experience. And that is the way i do autotrading at the moment. But i use my own broker adapter.
I know that i can use market oder in my code, but this is not the solution i am looking for. Because i can´t switch easily between both methods.
Wegi
I will need some time too test it.
But now i don´t understand why there was 1 pending limit order in the tws last night.
I will take a look at this to find the problem.
And that´s why i want to convert every limit order to an market order at my broker like this:
Limit Order in the Chart pending -> no Order at the Broker.
Limit Order filled in the Chart -> buy/sell at Market at the Broker.
This causes less problems with limit orders at my broker. This is my experience. And that is the way i do autotrading at the moment. But i use my own broker adapter.
I know that i can use market oder in my code, but this is not the solution i am looking for. Because i can´t switch easily between both methods.
Wegi