Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

OnStateChange() calls with State == Configure

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.

    #2
    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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Sparkyboy, Today, 10:57 AM
    0 responses
    1 view
    0 likes
    Last Post Sparkyboy  
    Started by TheMarlin801, 10-13-2020, 01:40 AM
    21 responses
    3,916 views
    0 likes
    Last Post Bidder
    by Bidder
     
    Started by timmbbo, 07-05-2023, 10:21 PM
    3 responses
    152 views
    0 likes
    Last Post grayfrog  
    Started by Lumbeezl, 01-11-2022, 06:50 PM
    30 responses
    809 views
    1 like
    Last Post grayfrog  
    Started by xiinteractive, 04-09-2024, 08:08 AM
    3 responses
    11 views
    0 likes
    Last Post NinjaTrader_Erick  
    Working...
    X