• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to determine if Strategy is being Backtested or Optimized in Strategy Analyzer

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

    How to determine if Strategy is being Backtested or Optimized in Strategy Analyzer

    The reason I ask is that it works better to turn off plotting and drawing during Optimize but not Backtest.

    Is there a way to distinguish between them?
    Backtest type Sets the backtest type.

    1. Standard

    2. Optimization
    I pasted the two options you can see in the strategy analyzer.

    Right now, I have all plotting and Drawing turned off when Account.Name == @"Backtest";

    Is there a more precise way?

    #2
    Hello SapientTrader,
    Thanks for your post.

    I was able to check the number of Optimizer iterations in order to differentiate between backtest and optimization, but I also needed to access an undocumented variable in order to ensure I was in the Strategy Analyzer. IsInStrategyAnalyzer is not documented so I cannot make any guarantees on its usage or provide any support for it going forward. Something like the following snippet will print "true" if the optimizer is being used and "false" if in a backtest.

    Code:
                if(Optimizer != null && IsInStrategyAnalyzer)
                    Print("in optimization ?  " + (Optimizer.NumberOfIterations > 1 ? "true" : "false" ));

    Please let me know if we can be of further assistance.
    Josh G.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by faisamtrader, Today, 10:03 PM
    0 responses
    1 view
    0 likes
    Last Post faisamtrader  
    Started by johnnybegoode, Today, 08:11 PM
    0 responses
    2 views
    0 likes
    Last Post johnnybegoode  
    Started by Bionian, Today, 02:47 PM
    2 responses
    19 views
    0 likes
    Last Post Bionian
    by Bionian
     
    Started by RickB60, Today, 01:55 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by filopearson, Today, 01:18 PM
    6 responses
    11 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X