Based on debugging, it would appear that NT is failing after calling the Initialize() in the strategy, but never calls OnStartUp(). When I set breakpoints in Visual Studio at the last line in Initialize() and the first line of OnStartUp(), the breakpoint in OnStartUp() is never reached.
I am running the strategy with market reply data. If I switch the date one or two times to test different time periods, NT will fail to load the strategy at any of those reloads. But it varies--I do not see any consistency to indicate when it will fail.
There is nothing in the log to indicate an error of any type.
Since this is occurring after the strategy's Initialize() and before OnStartUp(), I have no idea how to determine exactly where NT is failing.
Using my own debug code, here is what I see when it works *correctly*:
In Initialize() for rfMTFMAStatus Strategy Intialize() complete **NT** Enabling NinjaScript strategy 'MTFMA Trading Strategy/bd5e003128124d2f9d792e088e553a5f' : On starting a real-time strategy - StrategySync=WaitUntilFlat SyncAccountPosition=False EntryHandling=UniqueEntries EntriesPerDirection=1 StopTargetHandling=PerEntryExecution ErrorHandling=StopStrategyCancelOrdersClosePositions ExitOnClose=False Set order quantity by=Strategy ConnectionLossHandling=KeepRunning DisconnectDelaySeconds=10 CancelEntryOrdersOnDisable=False CancelExitOrdersOnDisable=True CalculateOnBarClose=False MaxRestarts=4 in 5 minutes In OnStartUp: MTFMA Strategy.... In CreateHigherTimeFrameIndicators.... Adding higher timeframe MA indicators: 150 Tick In OnStartUp: rfMovingAverage PPMA Fast (SMA-1).... In OnStartUp: rfMovingAverage PPMA Slow (SMA-3).... In OnStartUp: rfDualMovingAverage PPMA Dual MA: PPMA Fast (SMA-1) & PPMA Slow (SMA-3).... In OnStartUp: rfMovingAverage Trigger Fast (EMA-8).... In OnStartUp: rfMovingAverage Trigger Slow (SMA-13).... In OnStartUp: rfDualMovingAverage Trigger Dual MA: Trigger Fast (EMA-8) & Trigger Slow (SMA-13).... In OnStartUp: rfExpansionContraction.... In OnStartUp: rfMovingAverage DMA1 (SMA-20).... In OnStartUp: rfMTFMAStatus
In Initialize() for rfMTFMAStatus Strategy Intialize() complete **NT** Enabling NinjaScript strategy 'MTFMA Trading Strategy/1dc6f2ee01c14f93b40b084500329641' : On starting a real-time strategy - StrategySync=WaitUntilFlat SyncAccountPosition=False EntryHandling=UniqueEntries EntriesPerDirection=1 StopTargetHandling=PerEntryExecution ErrorHandling=StopStrategyCancelOrdersClosePositions ExitOnClose=False Set order quantity by=Strategy ConnectionLossHandling=KeepRunning DisconnectDelaySeconds=10 CancelEntryOrdersOnDisable=False CancelExitOrdersOnDisable=True CalculateOnBarClose=False MaxRestarts=4 in 5 minutes In OnStartUp: rfExpansionContraction.... In OnStartUp: rfMovingAverage PPMA Fast (SMA-1).... In OnStartUp: rfMovingAverage PPMA Slow (SMA-3).... In OnStartUp: rfDualMovingAverage PPMA Dual MA: PPMA Fast (SMA-1) & PPMA Slow (SMA-3).... In OnStartUp: rfMovingAverage Trigger Fast (EMA-8).... In OnStartUp: rfMovingAverage Trigger Slow (SMA-13).... In OnStartUp: rfDualMovingAverage Trigger Dual MA: Trigger Fast (EMA-8) & Trigger Slow (SMA-13).... In OnStartUp: rfMTFMAStatus In OnStartUp: rfMovingAverage DMA1 (SMA-20).... rfMTFMAStatus: indicators not yet defined rfMTFMAStatus: indicators not yet defined
The strategy is too involved to create a "toy" version.
How would I even begin to determine why NT is failing? Any debugging/logging mode that can be used?
Comment