Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BackTest missing data

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

    BackTest missing data

    I'm having an issue where NT7 is skipping/missing data in a backtest; I have no idea why and I cannot solve the problem. When I try to run a backtest for 2019 year to date it skips the week of 26 - 30 August 2019. I am using 60 minute bars on the USDJPY.

    I have checked in the historical data manager (I even double checked the C:\Documents\NinjaTrader 7\db\minute\folder) and confirmed that the data is actually there. I have a connection via FXCM (for forex) and I can connect to it every time no problems. I can even load a chart and see the market data for the "missing" time period. I have tried running the backtest with an active connection to FXCM and without i.e. disconnecting - but the same problem occurs both times.

    I thought there might have been a bug in my script so I created a new blank script with nothing but a print command [of time stamps], but I still get the same issue of the same data being skipped.

    I am using the Add() method to add bid/ask data in the Initialize() method:

    Code:
                Add(Instrument.FullName,PeriodType.Minute,BarsPeriod.Value,MarketDataType.Bid);    
                Add(Instrument.FullName,PeriodType.Minute,BarsPeriod.Value,MarketDataType.Ask);
    Then in BarsInProgress I loop through each bars array and print the time stamps. I find that August 26 - 30 is missing on bid, ask & last (the latter being the default value I have in the strategy analyzer window as the primary bars array).

    Code:
            if(BarsInProgress ==0)
            {
                for (i = 0; i < 3; i++)
                {
                    Print(Instrument.FullName+" "+BarsPeriods[i].MarketDataType+" data "+Times[i][0]);
                }
            }
    I'm hoping there is a solution other than deleting the cache and resetting the database. I am quite happy with NinjaTrader for the most part...but I do find these sorts of data issues crop up from time to time with the FXCM connection and backtesting. It is very frustrating because it undermines the confidence I can take from any result generated.

    Any help would therefore be much appreciated.

    #2
    Hello newuser,

    Thank you for your post.

    I would try deleting and redownloading your historical data before we jump to resetting the database.

    To delete your historical data please follow the steps below:
    • Within the Control Center go to Tools> Historical Data Manager> Edit
    • Select the data you want to delete, right-click on it, and select 'Delete'
    • Once the data has been deleted close NinjaTrader
    • Open the Documents\NinjaTrader7\db\cache folder
    • Select all files then right mouse click and select 'Delete'
    • Open NinjaTrader and connect to your data provider

    I have provided a link below to our Help Guide that goes over how to delete historical data.
    Once you've deleted the existing data, please redownload the data using the Historical Data Manager and test. Make sure you're downloading the Ask and Bid data too, not just the Last.

    Thanks in advance; I look forward to assisting you further.


    Kate W.NinjaTrader Customer Service

    Comment


      #3
      That seems to have worked, thanks.

      It would be nice to be able to prevent these sorts of things from happening in future but at least there's a way to fix the problem when it occurs.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by judysamnt7, 03-13-2023, 09:11 AM
      4 responses
      59 views
      0 likes
      Last Post DynamicTest  
      Started by ScottWalsh, Today, 06:52 PM
      4 responses
      36 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Today, 07:39 PM
      0 responses
      7 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Today, 03:01 PM
      2 responses
      21 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Today, 07:24 PM
      0 responses
      10 views
      0 likes
      Last Post cre8able  
      Working...
      X