Look at this trace. It contains information from your order update as well as a dump of all orders i get on the OnOrderUpdate method:
24/07/2009 10:34:53 Entered internal PlaceOrder() method at 24/07/2009 10:34:53: Action=SellShort OrderType=Market Quantity=1 LimitPrice=0 StopPrice=0 SignalName='HA1 S' FromEntrySignal=''
ONOD: Order='NT-00000/Sim101' Name='HA1 S' State=PendingSubmit Instrument='YM 09-09' Action=SellShort Limit price=0 Stop price=0 Quantity=1 Strategy='HeinekenAshiReversal' Type=Market Tif=Gtc Oco='' Filled=0 Fill price=0 Token='dd571aa47141409987e153d5e736b998' Gtd='01/12/2099 00:00:00'
ONOD: Order='NT-00000/Sim101' Name='HA1 S' State=Accepted Instrument='YM 09-09' Action=SellShort Limit price=0 Stop price=0 Quantity=1 Strategy='HeinekenAshiReversal' Type=Market Tif=Gtc Oco='' Filled=0 Fill price=0 Token='dd571aa47141409987e153d5e736b998' Gtd='01/12/2099 00:00:00'
ONOD: Order='NT-00000/Sim101' Name='HA1 S' State=Working Instrument='YM 09-09' Action=SellShort Limit price=0 Stop price=0 Quantity=1 Strategy='HeinekenAshiReversal' Type=Market Tif=Gtc Oco='' Filled=0 Fill price=0 Token='dd571aa47141409987e153d5e736b998' Gtd='01/12/2099 00:00:00'
ONOD: Order='NT-00000/Sim101' Name='HA1 S' State=Filled Instrument='YM 09-09' Action=SellShort Limit price=0 Stop price=0 Quantity=1 Strategy='HeinekenAshiReversal' Type=Market Tif=Gtc Oco='' Filled=1 Fill price=9028 Token='dd571aa47141409987e153d5e736b998' Gtd='01/12/2099 00:00:00'
24/07/2009 10:34:53 Entered internal PlaceOrder() method at 24/07/2009 10:34:53: Action=Sell OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=9044 SignalName='HA1 STP' FromEntrySignal='HA1 S'
24/07/2009 10:34:53 Ignored PlaceOrder() method: Action=Sell OrderType=Stop Quantity=1 LimitPrice=0 StopPrice=9044 SignalName='HA1 STP' FromEntrySignal='HA1 S' Reason='This was an exit order but no position exists to exit'
Why the hell is my command to enter a stop order IGNORED when the preceding order was filled?
All my processing happens in the OnOrderUpdate event. I can not use the OnExecution event, because - i clean out completed orders out of my management. So, by the time OnExecution runs, i dont even know the order anymore in my trade manager.
Anyone has a STATE DIAGRAM? Flow Diagram? Some proper documentation how that all is supposed to work together or a way to enter orders withhout your rotten logic silently ignoring it?
I spent the whole weekend trying to get sensible event driven order management in, because while you do signal based position tracking, you do not expose it to the user, so I need to replace the whole stuff. Now I am still stuck with what should be a job I should not even have to do.
3 days later, and still orders just get ignored.
Comment