Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is it possible for a strategy to not run a historical backtest when enabled?

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

    Is it possible for a strategy to not run a historical backtest when enabled?

    Hello,

    I do not want my strategy to run a historical backtest when I enable my strategy because it takes a VERY long time (strategy is extremely complicated) AND I have a variable in the strategy that changes to a value that I do not want when the strategy undergoes historical backtesting prior to running on SIM or live trading.

    Basically I want the strategy to start with default variable values (not modified by what occurs during historical backtest), and I do not want the historical backtest to be run at all.I want the strategy to start processing data when it is enabled, and not be influenced by historical data.

    How can I do this in strategy builder?

    #2
    Hello burmaz,

    In the Strategy Builder you would need to add to every condition Misc -> Current state, Equals, Misc -> State Realtime.


    In an unlocked script you could do this with 2 simple lines of code at the top of OnBarUpdate().

    if (State == State.Historical)
    return;

    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Originally posted by NinjaTrader_ChelseaB View Post
      Hello burmaz,

      In the Strategy Builder you would need to add to every condition Misc -> Current state, Equals, Misc -> State Realtime.


      In an unlocked script you could do this with 2 simple lines of code at the top of OnBarUpdate().

      if (State == State.Historical)
      return;

      https://ninjatrader.com/support/foru...541#post811541
      Thank you for your help! That answered my issue.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      41 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      124 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      64 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      41 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X