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

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 trader252, Today, 08:38 PM
      0 responses
      2 views
      0 likes
      Last Post trader252  
      Started by ralett, Today, 06:20 PM
      0 responses
      4 views
      0 likes
      Last Post ralett
      by ralett
       
      Started by grizzlytrader, Today, 06:24 AM
      1 response
      20 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by andrewtrades, Today, 01:43 PM
      1 response
      6 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by FuturesRon, Today, 03:09 AM
      1 response
      18 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Working...
      X