I am testing a new order management system using NT's simple MA strategy and I'm running into the "An Enter() method to submit an entry order....has been ignored" error. I can reproduce this issue. So, there's something systemic about how trade orders are being handled.
First, here's the problem:
(i) Sometimes ALL the Trade Set's orders get submitted and accepted OR (ii) ONLY the market order per trade set gets submitted and the limit orders don't get submitted for the trade set. A trade set contains 1x market order & 5 x limit orders invoked at the time of signal.
- Timeframe: 3M, single timeframe
- Asset: ES
- Strategy: long and short
- # Trades: 8 trades max per direction
- Exit on session close
My system trades in trade sets. A trade set contains 1 x market order and 5 x limit orders. The same for both longs and shorts.
So, a long trade set uses the following Enter() methods:
(1) entryOrder_1 = EnterLong(quantity_1, order_1);
(2) entryOrder_2 = EnterLongLimit(0, true, quantity_2, order_2);
...
(6) entryOrder_6 = EnterLongLimit(0, true, quantity_6, order_6);
I've simplified the above but that captures the gist.
(7) OnOrderUpdate(...) I save the Order object for future reference for each trade order for the trade set using the name of the order to then save the results in a Dictionary object.
The problem appears to manifest itself after the first trade set.
(a) The first trade for the 2 week timeframe I'm testing is short. So, 6 short trade orders are submitted and I can see all 6 trade orders when I trace order.ToString() OnOrderUpdate().
(b) Some short orders get filled, some are "waiting" for the right "limit" price to get filled. So far, so good.
(c) Long signal gets triggered
(d) All 6 x short orders get submitted for cancelation
(e) 1st long market order gets submitted -- and awaits the shorts to get closed
(f) NONE of the other 5 x long limit orders get submitted -- error message
(g) Error message: "An Enter() method to..."
(h) All short positions and pending orders get closed or canceled
(i) Long market order gets filled. None of the other long limit orders get submitted or filled.
(j) Strategy continues to move forward
(k) etc....
So...Sometimes ALL the Trade Set's orders get submitted and accepted OR (ii) ONLY the market order per trade set gets submitted and filled and the limit orders don't get submitted.
Thanks,
Big Surf
Comment