I noticed this unexpected behavior in one of my multi-instrument strategies. I then restarted Ninjatrader and it was only called once. Results were 100% identical both times, but it ran much faster when NT only went through the State == Configure block once.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
OnStateChange() calls with State == Configure
Collapse
X
-
OnStateChange() calls with State == Configure
What could cause NT to call OnStateChange with State==Configure multiple times in a strategy during the Strategy Analyzer?
I noticed this unexpected behavior in one of my multi-instrument strategies. I then restarted Ninjatrader and it was only called once. Results were 100% identical both times, but it ran much faster when NT only went through the State == Configure block once.Tags: None
-
Hello MM345,
Thanks for your inquiry.
State.Configure will be called in the Strategy Analyzer for each back test iteration. This would mean that State.Configure would be called multiple times for optimization backtests.
We advise to use State.Configure to reset class level variables that are not dependent on Bars objects so the strategy can use IsInstantiatedOnEachOptimizationIteration for faster and more memory efficient optimization backtests.
Please see the "Resetting class level variables for Strategy Analyzer Optimization" section of the Best Practices linked below for more information.
Best Practices - https://ninjatrader.com/support/help...urceManagement
IsInstantiatedOnEachOptimizationIteration - https://ninjatrader.com/support/help...niteration.htm
Please let us know if we can be of further assistance.JimNinjaTrader Customer Service
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by wzgy0920, Yesterday, 09:53 PM
|
2 responses
49 views
0 likes
|
Last Post
by wzgy0920
Today, 10:29 PM
|
||
Started by Kensonprib, 04-28-2021, 10:11 AM
|
5 responses
191 views
0 likes
|
Last Post
by Hasadafa
Today, 10:19 PM
|
||
Started by GussJ, 03-04-2020, 03:11 PM
|
11 responses
3,230 views
0 likes
|
Last Post Today, 08:07 PM | ||
Started by andrewtrades, Today, 04:57 PM
|
1 response
14 views
0 likes
|
Last Post Today, 05:02 PM | ||
Started by chbruno, Today, 04:10 PM
|
0 responses
7 views
0 likes
|
Last Post
by chbruno
Today, 04:10 PM
|
Comment