I have this persistent problem (first seen in NT6.5) which is again materializing in NT7.
- I put in a exit limit order.
- After waiting X seconds (and the limit order isn't filled), I cancel the limit order.
- In the OnOrderUpdate() for the canceled order, after seeing the order is fully canceled, I enter a new exit at market order.
Unfortunately, sometimes Ninja chokes on this and ends up with:
5/26/2011 4:31:32 AM Entered internal PlaceOrder() method at 5/26/2011 4:31:32 AM: BarsInProgress=7 Action=BuyToCover OrderType=Market Quantity=3 LimitPrice=0 StopPrice=0 SignalName='MexitKC 07-11|72|LN 161' FromEntrySignal='KC 07-11|72|LN 161'
5/26/2011 4:31:32 AM Ignored PlaceOrder() method: Action=BuyToCover OrderType=Market Quantity=3 LimitPrice=0 StopPrice=0 SignalName=MexitKC 07-11|72|LN 161' FromEntrySignal='KC 07-11|72|LN 161' Reason='There already is a matching, filled exit order in place'
... I don't know how it determined there is a "matching, filled exit order in place". There are no other pending/filled orders for this instrument within the previous hours. I wonder if its referring to the (unfilled) canceled limit order.
So, two questions:
1) Is there something I can or should do differently to get Ninja to fill this order correctly?
2) Can someone give me a quick primer on the "unmanaged" enter/exit orders? Can I mix/match the usage of those orders with the standard versions, or do I have to commit to one or the other?
EDIT: Let me clarify, there is clearly some kind of a race condition going on. This problem doesn't happen EVERY time... it only happens every.. 20? 30? similar orders. So, there must be some kind of state in the Ninja order-handling background that isn't being set/cleared correctly.
Comment