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

Backtest data: not 20 bars from first strategy operation

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

    Backtest data: not 20 bars from first strategy operation

    Hi,

    I was backtesting over a 3 month period of 1/Oct-31/Dec using only 1min bar data. I then added daily bars as a second time frame by using Add(PeriodType.Day, 1). The code was otherwise unchanged. I then added 20 working days to the backtest date range because I know that I will not get any output until after the first 20 bars of data and as I have now added daily data, that means adding 20 days to the start of the backtest data set. However, my log info did not start on the 1/Oct as expected and through trial and error I found that I had to include data back to 15/Aug to ensure that log information began on 1/Oct. This is 33 working days before the 1/Oct? That's not much to go on but what might be my issue here?

    Thanks in advance,
    darmbk.

    #2
    darmbk, that could actually be the case since you would need to have 20 daily data points running with the default BarsRequired setting of 20 for your script and factoring weekends and holidays it could need more calendar days to satisfy this requirement. You could either add then more data in or set BarsRequired lower to adjust.
    BertrandNinjaTrader Customer Service

    Comment


      #3
      Hi Bertrand,

      Thanks for you response. If I currently have 'min bars required' set to the default of 20 and ignoring any coding errors, is there any high level reason I might not get results if 15/Aug-1/Oct is 33 weekdays?

      Thanks,
      darmbk.

      Comment


        #4
        You could an easy test here to further isolate out, if you force BarsRequired really low, any change in the outcome seen then for your script?
        BertrandNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by traderqz, Today, 12:06 AM
        8 responses
        14 views
        0 likes
        Last Post traderqz  
        Started by SightCareAubetter, Today, 12:50 PM
        0 responses
        1 view
        0 likes
        Last Post SightCareAubetter  
        Started by Mongo, Today, 11:05 AM
        4 responses
        14 views
        0 likes
        Last Post Mongo
        by Mongo
         
        Started by Skifree, Today, 03:41 AM
        5 responses
        13 views
        0 likes
        Last Post Skifree
        by Skifree
         
        Started by traderqz, Yesterday, 09:06 AM
        5 responses
        35 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X