Announcement

Collapse

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

Collapse

Unpredictable behaviour of Strategy Analyzer

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

    Unpredictable behaviour of Strategy Analyzer

    Hello

    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,
    Sergey

    #2
    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:

    Code:
        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:
    NinjaTrader is an award winning end to end online trading platform for discretionary and automated trading for stocks, futures and forex.Download NinjaTrader...


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

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by lorem, Yesterday, 09:18 AM
    4 responses
    14 views
    0 likes
    Last Post lorem
    by lorem
     
    Started by Spiderbird, Today, 12:15 PM
    0 responses
    5 views
    0 likes
    Last Post Spiderbird  
    Started by cmtjoancolmenero, Yesterday, 03:58 PM
    12 responses
    42 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by FrazMann, Today, 11:21 AM
    0 responses
    6 views
    0 likes
    Last Post FrazMann  
    Started by geddyisodin, Yesterday, 05:20 AM
    8 responses
    52 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X