Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Backtest detection

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

    Backtest detection

    Hi, how can i trigger some functions in strategy only in backtest?

    #2
    Hello Victor_Zelenyi,
    Thanks for your post.

    You can determine if your strategy is running in the Strategy Analyzer by doing something similar to:

    Code:
    if(IsInStrategyAnalyzer)
    {
        Print("The Strategy Is Running In The Strategy Analyzer");
    }
    Last edited by NinjaTrader_JoshG; 01-30-2019, 09:27 AM.
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      Thank you.

      Comment


        #4
        But if running backtest type != "Backtest" IsInStrategyAnalyzer returns false.
        How to detect if strategy is running in the Strategy Analyzer for other backtest types?

        Comment


          #5
          Hello Klaus,

          Please see the post below which shows how you can differentiate backtest types.



          We look forward to assisting.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by argusthome, 03-08-2026, 10:06 AM
          0 responses
          111 views
          0 likes
          Last Post argusthome  
          Started by NabilKhattabi, 03-06-2026, 11:18 AM
          0 responses
          59 views
          0 likes
          Last Post NabilKhattabi  
          Started by Deep42, 03-06-2026, 12:28 AM
          0 responses
          38 views
          0 likes
          Last Post Deep42
          by Deep42
           
          Started by TheRealMorford, 03-05-2026, 06:15 PM
          0 responses
          41 views
          0 likes
          Last Post TheRealMorford  
          Started by Mindset, 02-28-2026, 06:16 AM
          0 responses
          78 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Working...
          X