• 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.
    JoshNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by alextrd, Today, 01:51 PM
    0 responses
    6 views
    0 likes
    Last Post alextrd
    by alextrd
     
    Started by Boonfly8, Today, 12:10 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by NinjaTrader_PaulH, Today, 11:24 AM
    0 responses
    4 views
    0 likes
    Last Post NinjaTrader_PaulH  
    Started by catulopc, Today, 10:58 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_SergeyS  
    Started by swcooke, Today, 09:20 AM
    7 responses
    22 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X