Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Load additional history for one instrument

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

    Load additional history for one instrument

    Hi,

    In a multi instrument and multi timeframe strategy is it possible to load additional history for one instrument only? For example I may want to perform calculations on the last 60 days of daily bars but only the last two days on 15 min bars. I.e. Is there a function I can call which explicitly loads a defined range of history for a specified instrument and timeframe and doesn't load this data form other instruments in the strategy.

    Aim is to maintain performance of strategy by only processing required data.

    This is applicable to both backtesting and live strategies.

    Thanks

    #2
    Actually I've just seen this

    AddDataSeries(string instrumentName, BarsPeriod barsPeriod, int barsToLoad, string tradingHoursName, bool? isResetOnNewTradingDay)

    I'm assuming if I set the primary bar series on a strategy to be 15 mins and history to be 20 days when used the above set at 60 days it would meeting the requirements?



    Thanks

    Comment


      #3
      Hello tmfdouglas,

      You could use the AddDataSeries syntax,

      AddDataSeries(string instrumentName, BarsPeriod barsPeriod, int barsToLoad, string tradingHoursName, bool? isResetOnNewTradingDay)

      Which allows you to specify how many bars to load of the secondary data series. However you would have to hard code the instrument name which would have to be changed on any roll if you’re trading futures.

      A better approach might be to just set maximumbarslookback to 256, which would limit the secondary series to 256 bars. Whether your strategy pulls 2 bars or 256 bars, I think the impact on performance is minimal. See the following section of our helpguide,



      Please let us know if you need further assistance.
      Alan P.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by NullPointStrategies, Today, 05:17 AM
      0 responses
      44 views
      0 likes
      Last Post NullPointStrategies  
      Started by argusthome, 03-08-2026, 10:06 AM
      0 responses
      125 views
      0 likes
      Last Post argusthome  
      Started by NabilKhattabi, 03-06-2026, 11:18 AM
      0 responses
      65 views
      0 likes
      Last Post NabilKhattabi  
      Started by Deep42, 03-06-2026, 12:28 AM
      0 responses
      42 views
      0 likes
      Last Post Deep42
      by Deep42
       
      Started by TheRealMorford, 03-05-2026, 06:15 PM
      0 responses
      46 views
      0 likes
      Last Post TheRealMorford  
      Working...
      X