Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90


Unpredictable behaviour of Strategy Analyzer

  • Filter
  • Time
  • Show
Clear All
new posts

    Unpredictable behaviour of Strategy Analyzer


    I have some questions about unpredictable behaviour of Strategy Analyzer.

    1) Why quantity of deals can be different if I don`t have any connection to Playback Connection or I have it?
    2) Why Stoploss/Takeprofit are different for Analyzer and for Replay? Some stoploss/takeprofit are missing in Analyzer
    3) Why I don`t see any comment about item #2 in Log in Ninja?
    4) Why Analyzer so unpredictable?

    Thanks a lot,

    Hello sergey_z,

    Thank you for your post.

    For your first question, generally we discourage using the Strategy Analyzer with the Playback Connection together. When using these together in NT8, there are some considerations you must take into account:
    • Historical data requests are influenced by the slider position.
    • The playback slider's location is considered the present. This means
      • Played-over bars are available to the Strategy Analyzer.
      • Historical data in the future of the playback slider are not available to the Strategy Analyzer
    This can cause your Strategy Analyzer results to be considerably different than if you were running it while connected to a normal, real-time data feed.

    As to your second question, differences in fills between backtesting on Market Replay data using the Playback connection vs backtesting with the Strategy Analyzer are expected. This is due to differences in available data between the two.

    During a backtest, fills are determined based on 4 data points, OHLC of a bar since that is the only information that is known during a backtest and there will be no intra-bar data. This means actions cannot happen intra-bar, fills cannot happen intra-bar. All prices and actions come from and occur when the bar closes as this is all the information that is known.

    Because of this, OnBarUpdate will only update 'On bar close' as it does not have the intra-bar information necessary for 'On price change' or 'On each tick'.

    Here is a link to our help guide that goes into more detail:

    As far as not seeing comments regarding missed or rejected orders, I recommend turning on the Order Trace function for your strategy if this is one you created yourself.

    Strategy Builder > Default Properties > More Properties > Trace Orders, or:

        if (State == State.SetDefaults) 
            TraceOrders = true; 
    Once you then recompile the strategy, you can open a new NinjaScript Output window under New > NinjaScript Output. This will print a log of any orders submitted by the strategy during while it's running, along with any ignored orders. You can then look through and see what may be occurring.

    Here is a link to our help guide that goes into more detail on tracing orders:

    As for being unpredictable, I would say it's actually quite predictable. Understanding how the Analyzer functions is integral to being able to properly utilize it as a tool. Understanding the information about discrepancies linked above will also help your results be more predictable. Here is a link to our help guide on the Strategy Analyzer:

    Also, here is a publicly available video that goes over the Strategy Analyzer:

    Please let us know if we may be of further assistance to you.
    Kate W.NinjaTrader Customer Service


    Latest Posts


    Topics Statistics Last Post
    Started by tonynt, Today, 11:50 AM
    0 responses
    Last Post tonynt
    by tonynt
    Started by Welovethelibrary, Today, 11:44 AM
    0 responses
    1 view
    Last Post Welovethelibrary  
    Started by goodknight777, Today, 11:39 AM
    0 responses
    Last Post goodknight777  
    Started by MohammedAmine, Today, 10:44 AM
    1 response
    Last Post NinjaTrader_Kate  
    Started by Nolyn, Today, 10:59 AM
    1 response
    Last Post NinjaTrader_BrandonH