Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Ignoring historical data doesnt work on multiinsturment strategy

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

    Ignoring historical data doesnt work on multiinsturment strategy

    Hello, I have a problem with skipping historical data in my strategy.

    In initialize function i have:

    Code:
    Add(PeriodType.Day, 1); // BarsArray[1]
    //Add(PeriodType.Week, 1); // BarsArray[2]
    //Add(PeriodType.Month, 1); // BarsArray[3]
    and in onBarUpdate()

    Code:
    if(Historical) {
    return;
    }
    If the week and month timeframe adds are commented out, historical data are filtered out as expected. But when I uncomment them (not even using their data), then historical data are being processed causing my strategy to act on old data.

    Tested with Days to Load: 70 and min bars required 20

    Am I missing anything? Thanks.

    #2
    Hi Dukecz, which primary series are you using here?

    The min bars required would need to be fulfilled for all series - so 20 bars data for monthly as well, which your DaysToLoad (based on calendar days) would not be able to provide - you would need to increase it here significantly.

    Comment


      #3
      Originally posted by NinjaTrader_Bertrand View Post
      Hi Dukecz, which primary series are you using here?

      The min bars required would need to be fulfilled for all series - so 20 bars data for monthly as well, which your DaysToLoad (based on calendar days) would not be able to provide - you would need to increase it here significantly.
      Thanks, that fixed the problem. I have been using 1 and 5 min as primary data series.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      80 views
      1 like
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      40 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      63 views
      2 likes
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      63 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      54 views
      0 likes
      Last Post CarlTrading  
      Working...
      X