Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Back test vs historical chart loading

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

    Back test vs historical chart loading

    I have an indicator that prints lots of labels on a chart. This drastically slows down the back testing engine when testing large amounts of time because of the chart it builds at the end. I would like for the indicator to not print the labels during back testing, but be able to print them on the historic data when I manually open a chart. Is there a way to do this? Are there any States unique to back testing or a chart loading outside of the strategy analyzer that I can check for?

    If not I guess I could check the timestamp of the bar and compare it to the current date and only print labels for the last x days...? Any other ideas?

    Thanks,
    Nick

    #2
    Hello NickyD,

    Thank you for the question.

    The option with the most flexibility would be to add a bool input to the script. You could set it to default as True so you don't need to mess with it outside of the backtest, in a backtest, you could set it to false to disable drawing. This would also allow you to disable the drawings in the chart to increase performance when they are not needed.

    Alternatively there is a property for backtesting:

    Code:
    Print(IsInStrategyAnalyzer);
    You would need to use this bool from your strategy, and then change the properties of the indicator based on its value. The above statement about adding a bool input would still apply to the indicator while using IsInStrategyAnalyzer, the input would be used to control the indicator.


    I look forward to being of further assistance.
    Last edited by NinjaTrader_Jesse; 10-04-2018, 10:30 AM.

    Comment


      #3
      A good solution. Thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      633 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      364 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      105 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      567 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      568 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X