In some of my backtest cases, the execution of a strategy will suddenly stop. I'm wondering if it's related to RealtimeErrorHandling.
Here's what I see in my debugging output:
2/28/2008 7:00:00 AM Amended stop order: Order='NT-00001/Back101' Name='Stop loss' State=Working Instrument='ABH' Action=Sell Limit price=0 Stop price=15.75 Quantity=100 Strategy='ProtectDown' Type=Stop Tif=Gtc Oco='NT-00000' Filled=0 Fill price=0 Token='18121809b90642918fd6e5d11c8401a4' Gtd='12/1/2099 12:00:00 AM'
2/28/2008 7:00:00 AM Entered internal PlaceOrder() method at 2/28/2008 7:00:00 AM: Action=Sell OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName='' FromEntrySignal=''
2/28/2008 7:00:00 AM Cancelled pending exit order, since associated position is closed: Order='NT-00001/Back101' Name='Stop loss' State=Working Instrument='ABH' Action=Sell Limit price=0 Stop price=15.75 Quantity=100 Strategy='ProtectDown' Type=Stop Tif=Gtc Oco='NT-00000' Filled=0 Fill price=0 Token='18121809b90642918fd6e5d11c8401a4' Gtd='12/1/2099 12:00:00 AM'
I get this one last call in my OnOrderUpdate handler:
I know the docs for RealTimeErrorHandling mentions stopping the strategy (by default) if there is a rejected order... what about during back-testing? What if there's an error in exits as in this case? Could it be the cause for the strategy simply "ending"?
Comment