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

Strategy Analyzer Data

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

    Strategy Analyzer Data

    I have long been a user of market replay for testing strategies but I'm trying to use Strategy Analyzer more.
    So for a particular contract, I was getting a pretty big trading difference between m/r and s/a. Turns out, when I look at the chart that s/a produced, it's missing like 2 weeks of days.
    So then I guess I don't understand what data it's using. I was under the impression s/a would just use my m/r data for back-testing. Where am I going wrong?

    #2
    Hello reynoldsn,

    Thanks for your post.

    The Strategy Analyzer uses Historical data for backtesting a NinjaScript strategy, not Market Replay data.

    Only the Playback connection uses Market Replay data in NinjaTrader.

    If you are connected to a data feed provider that provides Historical data for the instrument you are backtesting on, the Strategy Analyzer will automatically download the Historical data from the data provider for the date range you are testing over.

    You could also consider downloading Historical data in the Tools > Historical Data window for the instrument and dates you are testing on followed by running a backtest on the strategy in the Strategy Analyzer.

    See this help guide page for more information about backtesting in the Strategy Analyzer: https://ninjatrader.com/support/help...a_strategy.htm

    See this help guide page on the differences between Historical data and Market Replay data: https://ninjatrader.com/support/help...gHowThePlaybac kWorks

    Please review the help guide document on the differences on real-time vs backtest (historical): https://ninjatrader.com/support/help...ime_vs_bac.htm

    A strategy running real-time (live brokerage account, live market simulation, Playback connection etc...) will produce different results than the performance results generated during a backtest.

    When in historical data, only the Open, High, Low, and Close will be available 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' and the script will not have the intra-bar information to accurately fill an order at the exact price and time.

    Below is a link to the help guide on Calculate.


    To improve the accuracy of a backtest, you may use Tick Replay along with an added 1-tick series to have logic processed intra-bar and have orders filled intrabar.

    Tick Replay would be used to have the logic process OnEachTick or OnPriceChange with historical data, but this does not allow for intra-bar order fills. You would need to add a single tick data series and submit orders to that single tick data series for a strategy that uses Tick Replay.

    High Order Fill Resolution allows for intra-bar order fills with historical processing, but is not compatible with Tick Replay.

    Please reference the SampleIntrabarBacktest example and the following Help Guide links for more information.

    SampleIntrabarBacktest 'Backtesting NinjaScript Strategies with an intrabar granularity': https://ninjatrader.com/support/help...ipt_strate.htm

    TickReplay: https://ninjatrader.com/support/help...ick_replay.htm

    Developing for Tick Replay: https://ninjatrader.com/support/helpGuides/nt8/developing_for__tick_replay.htm?zoom_highlightsub= developing+for+tick+replay

    Additional information may be found in this NinjaTrader Forum post: https://ninjatrader.com/support/foru...mance?t=102504
    Brandon H.NinjaTrader Customer Service

    Comment


      #3
      Hi Brandon,

      thank you for all the great links - I am familiar with some of them but definitely worth reviewing.

      Question,
      I know which folder market data is stored in.
      Please let me know which folder historical data is stored in and what file extension is used.

      Comment


        #4
        Hello reynoldsn,

        Thanks for your notes.

        Historical data is saved in the Documents\NinjaTrader 8\db folder.

        Historical Daily data will be located in the Documents\NinjaTrader 8\db\day folder.

        Historical Minute data will be located in the Documents\NinjaTrader 8\db\minute folder.

        Historical Tick data will be located in the Documents\NinjaTrader 8\db\tick folder.

        Please let us know if we may assist further.
        Brandon H.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by marco231, Today, 11:32 PM
        1 response
        4 views
        0 likes
        Last Post marco231  
        Started by sofortune, Today, 10:55 PM
        0 responses
        2 views
        0 likes
        Last Post sofortune  
        Started by sofortune, Today, 10:19 PM
        0 responses
        9 views
        0 likes
        Last Post sofortune  
        Started by sofortune, Today, 10:10 PM
        0 responses
        6 views
        0 likes
        Last Post sofortune  
        Started by sofortune, Today, 09:49 PM
        0 responses
        4 views
        0 likes
        Last Post sofortune  
        Working...
        X