Major Problem - Autotrader

Questions about MultiCharts and user contributed studies.
johnchan
Posts: 22
Joined: 07 Sep 2006

Major Problem - Autotrader

Postby johnchan » 07 May 2008

We are using MC Ver 3 and we are experiencing the following problem.
A large number of "buytocover this bar close" or "sell this bar close" orders are not being routed to TWS. We have checked the TWS audit report and the orders do not appear at all. No "Place Order", no "Acknowledged",
no "Cancelled" and obviously no "Filled". Since these orders are market orders and exit position orders it is a major problem which did not occur with the previous version. Our strategy also sends separate entry "limit" orders which are cancelled at bar end. Could this be interfering in some way with the exit maket orders which should not be cancelled until filled.

johnchan
Posts: 22
Joined: 07 Sep 2006

Postby johnchan » 07 May 2008

Further to my previous posting I noticed the following in your MC User Guide which may be the problem:
"BuyToCover
Completely or partially exits one or all of the short entries as specified by the parameters.
The exit point is visually indicated on a chart by an Arrow and a Tick. The Arrow identifies the time and the Tick identifies the price value of the exit point. Labels, displaying the exit name and the number of contracts or shares traded, are displayed below the Cover Arrow.

An order is executed at the point specified by the parameters; if the order is not filled within the specified bar, the order is cancelled. "....User Guide.

Buytocover orders must NOT be cancelled at bar close if the order is a market order. Only limit orders need be cancelled. If this is the cause this needs to be fixed ASAP otherwise there is no point in using range bars to set price limits when exits at market are cancelled. Also no professional trader wants to convert a failed limit order to market. Only benefits the IB coffers. One might as well route a market order in the first place.

Could you please confirm whether "buytocover" and "sell" MARKET orders are cancelled upon bar close and whether this would explain why the orders were not routed to IB.

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Re: Major Problem - Autotrader

Postby Marina Pashkova » 07 May 2008

We are using MC Ver 3 and we are experiencing the following problem.
A large number of "buytocover this bar close" or "sell this bar close" orders are not being routed to TWS. We have checked the TWS audit report and the orders do not appear at all. No "Place Order", no "Acknowledged",
no "Cancelled" and obviously no "Filled". Since these orders are market orders and exit position orders it is a major problem which did not occur with the previous version. Our strategy also sends separate entry "limit" orders which are cancelled at bar end. Could this be interfering in some way with the exit maket orders which should not be cancelled until filled.


Hi johnchan,

Market orders are not cancelled until filled.

The possible explanation of why you don't see market sell and buytocover orders submitted is as follows:

Sell and buytocover orders are the orders used to exit a position. The autotrading engine should only submit such orders if there is an open position.

Now, here's what used to happen in the old autotrading:
Say, you'd apply a strategy to a chart. By the time autotrading was enabled you would have a number of orders generated on historical data that might have resulted in an open position. The next order generated by the code (and the first order for autotrading) would be to close that position. Autotrading would not care that it was just started and that its marketposition was 0. It would send an order to close the virtual code-generated position. Which was wrong because TWS would not have any such open position and the order will actually enter a new position from 0.

The new autotrading has a different behavior. Whenever an order is generated, autotrading checks the market position to see if the order can be sent. So if the market position is 0, no exit orders will be sent.

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 07 May 2008

Further to my previous posting I noticed the following in your MC User Guide which may be the problem:
"BuyToCover
Completely or partially exits one or all of the short entries as specified by the parameters.
The exit point is visually indicated on a chart by an Arrow and a Tick. The Arrow identifies the time and the Tick identifies the price value of the exit point. Labels, displaying the exit name and the number of contracts or shares traded, are displayed below the Cover Arrow.

An order is executed at the point specified by the parameters; if the order is not filled within the specified bar, the order is cancelled. "....User Guide.

Buytocover orders must NOT be cancelled at bar close if the order is a market order. Only limit orders need be cancelled. If this is the cause this needs to be fixed ASAP otherwise there is no point in using range bars to set price limits when exits at market are cancelled. Also no professional trader wants to convert a failed limit order to market. Only benefits the IB coffers. One might as well route a market order in the first place.

Could you please confirm whether "buytocover" and "sell" MARKET orders are cancelled upon bar close and whether this would explain why the orders were not routed to IB.


Market orders are never cancelled. "Buytocover" and "sell" can only be cancelled if those are limit or stop orders and NOT market orders.


Return to “MultiCharts”