• 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.


No announcement yet.

Partner 728x90


Strategy Analyser backtesting - where does the data come from?

  • Filter
  • Time
  • Show
Clear All
new posts

    Strategy Analyser backtesting - where does the data come from?

    Newbie question: when using the strategy analyser to do backtesting, I can select any date range (say 1/1/2019 - 28/2/2019) and it performs the backtest without a glitch, whether or not I'm connected to my provider.

    How can I be sure that NT has all the data it needs to do an accurate backtest? Where is it getting this data from?

    I wasn't trading every day this year, and I haven't downloaded all the data for this year manually, so I'm fairly sure the data isn't cached locally.

    Hello thesorehead,

    Thank you for the question.

    The data you are seeing would be locally cached data which was at one point either downloaded from the data provider as historical data or was recorded from realtime into the historical cache. You can see what data you have in the historical data manager along with other management options: https://ninjatrader.com/support/help...ta_manager.htm

    To be sure the platform has the complete dataset, you would likely want to connect to the data provider and pull up a chart for that period of time and then Right click -> Reload all historical data. This will request the period of time from the provider and download what is available. The length of data you request will matter in case the provider does not offer that far back, in those situations you can choose to record live data as historical to build up a cache of data or import data from external sources.

    I look forward to being of further assistance.

    JesseNinjaTrader Customer Service


      Thanks Jesse. I pulled up a chart and set "Days to load" to 60. Browsing back through the chart it appears all the days are there, so hopefully that means all the data is in the cache!


        Originally posted by thesorehead View Post
        Where is it getting this data from?
        "Where it comes from" depends upon who your data provider is. For most users, this is probably Rithmic or Continuum, which means the historical data actually comes from the NinjaTrader historical data servers, which your NinjaTrader.exe connects to automatically when connecting to your Rithmic or Continuum account.

        This page,
        seems to state the historical data comes from the service provider, but I think what technically happens is that NT actually records the data in real-time from a single (I think) service provider to their own private internal file servers, and then later dispenses it to your NinjaTrader.exe on demand as historical data via a connection to NT's historical data servers (aka, their private internal file servers).

        Be aware there are limits to how much data NT stores on their historical data servers.
        I think NT only stores 1 year of Tick data for each instrument, where as Minute and Day historical data are practically infinite.

        Originally posted by thesorehead View Post
        How can I be sure that NT has all the data it needs to do an accurate backtest?
        If you are connected to your data feed provider, then Strategy Analyzer should automatically download any missing historical data.

        However, if your strategy does anything fancy with secondary data series using the Add() method, I'm not completely convinced(*) the data needed to satisfy the needs of the added data series would be automatically downloaded.

        In any event, you can manually download any needed historical data using the Historical Data Manager.

        CC -> Tools -> Historical Data Manager -> Download tab

        I usually check all the boxes Tick/Minute/Day and Ask/Bid/Last. I have my doubts as to the usefulness of the Bid/Ask historical data, but usually download it anyways. Set your start date as needed, and click the Download button.

        (*)For me, downloading all the data manually guarantees that my strategies running on minute bars also have the tick data needed for a 1-tick secondary data series.

        Some tips:
        1. Make sure to use the 64-bit version of NT to download, esp for large date ranges, esp for Tick data.
        2. The 32-bit version may eventually 'stall' due to the maximum 3GB memory limit on the process size.
        3. Backtests seem to run faster if you're disconnected from all data providers.

        You can check which historical data is stored on your system by checking the three folders where the files are stored,
        <My Documents>/NinjaTrader 7/db/day
        <My Documents>/NinjaTrader 7/db/minute
        <My Documents>/NinjaTrader 7/db/tick
        If you examine the names of the files in those folders (and subfolders) you will soon be able to determine what historical data you have and what historical data is missing.

        The data folder,
        <My Documents>/NinjaTrader 7/db/data
        is where Market Replay data is stored and is not used by the Strategy Analyzer.

        The cache folder,
        <My Documents>/NinjaTrader 7/db/cache
        is a special folder which caches the historical+realtime data most recently used by (for ex) a chart window.

        Sometimes you will see advice to delete the contents of this cache folder in order to fix a data problem.
        I do this fairly regularly and have never had a problem, just make sure that NT is not running when you do this.

        On a final note, be extra alert to the use of the term 'cache', it is a bit overloaded.

        The 'cache folder' is a very specific thing, but it is not the same thing as the general expression 'locally cached data'.

        The expression 'locally cached data' would refer to the historical data stored in the three "day/minute/tick" folders.
        Last edited by bltdavid; 03-04-2019, 07:57 PM.


        Latest Posts


        Topics Statistics Last Post
        Started by jamarc, Today, 02:30 AM
        1 response
        Last Post NinjaTrader_Jesse  
        Started by uday12, Yesterday, 04:19 PM
        1 response
        Last Post NinjaTrader_PaulH  
        Started by grose, Today, 06:53 AM
        2 responses
        Last Post grose
        by grose
        Started by Bobisam, Yesterday, 04:57 PM
        1 response
        Last Post NinjaTrader_PaulH  
        Started by voltlon, Yesterday, 05:18 PM
        1 response
        Last Post NinjaTrader_PaulH