PDA

View Full Version : Strategy Analyzer Will Not Load Strategy


KBJ
09-12-2007, 12:03 AM
I was editing and compiling, and then testing a strategy using the Strategy Analyzer, and all was working fine, then when I tried another edit, compile and backtest, but the backtest parameter screen came up with all values completely blank.

I stopped and restarted NinjaTrader (6.0.1000.5), no change.

I reinstalled NinjaTrader with "repair" option, no change.

I removed the NinjaTrader.mdb file and restarted NinjaTrader, and it created a new .mbd file, but still no change with the way the Strategy Analyzer treated just this one strategy.

I removed the NinjaTrader.Custom.dll and NinjaTrader.Custom.xml files and restarted NinjaTrader, but no change.

I did a save-as to rename my strategy, recompiled the strategy with the new name, and then tried to backtest it, and still I cannot select either the strategy. When I try to select either of the two strategies (original or renamed one), the parameters stay the same as whatever default strategy was originally displayed when the Strategy Analyzer was first started.

I can select any other strategy, and the parameter selection screen will change, except for the two that I'm having trouble with.

Any ideas?

Best regards,

KBJ

NinjaTrader_Dierk
09-12-2007, 01:37 AM
What are the logs saying?

KBJ
09-12-2007, 11:01 AM
I didn't think to check the log. Good tip.

The log says "Failed to call method 'Initialize' for strategy <name>. Object reference not set to an instance of an object."

I checked and found a reference to "TickSize" which I'm guessing is only defined in the OnBarUpdate() method, so it shouldn't have been in the Initialize() method.

Removing that, the problem is solved.

Thanks.

KBJ

OnePutt
09-14-2007, 12:24 PM
After using TICKSIZE in the INITIALIZE method I got the error message " Failed to call method 'Initialize' for strategy" and NT failed (when applying the strategy to a chart). Of course, I had changed 100 lines of code and got no compile error or any other error message to indicate that was the problem.

Without this POST I woud have been scratching my head for hours. Thank you KBJ and the Ninja Trader Support Forum.

If TICKSIZE can't be used in INITIALlZE why not at least document that fact in the manual? Better yet issue a diagnostic message in the log.

NinjaTrader_Dierk
09-14-2007, 12:49 PM
>> Better yet issue a diagnostic message in the log.
Will be changed with next update. Thanks for your suggestion.