Announcement

Collapse
No announcement yet.

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 reynoldsn, 01-06-2025, 06:21 PM
        4 responses
        32 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by reynoldsn, Yesterday, 09:26 AM
        4 responses
        25 views
        0 likes
        Last Post reynoldsn  
        Started by azh_ali, Today, 09:15 AM
        4 responses
        13 views
        0 likes
        Last Post azh_ali
        by azh_ali
         
        Started by morong0414, 11-21-2022, 09:23 AM
        126 responses
        15,625 views
        1 like
        Last Post Kmace20
        by Kmace20
         
        Started by Orion1504, Today, 09:27 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Working...
        X