Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Secondary data series causes cut off in historic bar processing.

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

    Secondary data series causes cut off in historic bar processing.

    I've been hunting a problem in my strategy which is related to historic bars not being processed. I have reduced it down to the following line of code in my Initialize() method:

    Code:
    Add(PeriodType.Minute, 1);
    When running my strategy this causes all bars of the 0 series (1440 minutes) to stop being processed before Dec. 1st 2014. This is what I have in my OnBarUpdate() method:

    Code:
    if (BarsInProgress == 0 && FirstTickOfBar) {
    	Print("\n" + Times[0][startIndexSeriesZero] + " GOT HERE!\n");
    	return;
    }
    Removing the Add method in my init method produces output of all 1440 bars on the chart. If I add the call it starts at 1/14/2014.

    My suspicion is that I'm not loading enough of the 2nd series - so how do I handle this?

    Thanks in advance.

    #2
    Alright - I just figured out what the issue is. Turns out I had the chart set to 300 bars and that setting will be applied to both series - although there are clearly more than 300 1-minute bars between now and December 14. In any case - when I set it to 300 days instead it loads all bars.

    Comment


      #3
      Molecool,

      All additional data series being added will adopt the primary instruments settings. If you have 365 days for the primary then the secondary will load that many days back as well.

      If you see that either the data doesn't go back that far you would want to check the Historical Data Manager and ensure that, that data is available.
      Cal H.NinjaTrader Customer Service

      Comment


        #4
        See message #2 - I already figured it out. For some reason setting the chart to 300 bars affects the secondary (smaller) series. Why I don't know - you guys probably would.

        Comment


          #5
          Originally posted by molecool View Post
          See message #2 - I already figured it out. For some reason setting the chart to 300 bars affects the secondary (smaller) series. Why I don't know - you guys probably would.
          Molecool,

          My previous post points out that any additional data series being added to the script will adopt the settings of the primary instrument that the script is being attached to, under the Data Series window for the chart

          Thus, since the primary was only loading 300 bars, then the secondary would only load 300 bars.
          Cal H.NinjaTrader Customer Service

          Comment


            #6
            Originally posted by NinjaTrader_Cal View Post
            Molecool,

            My previous post points out that any additional data series being added to the script will adopt the settings of the primary instrument that the script is being attached to, under the Data Series window for the chart

            Thus, since the primary was only loading 300 bars, then the secondary would only load 300 bars.
            Yes, that's how I understood it - and it makes sense. But at second thought there are a lot more than 300 1-minute bars when I do that.

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by Geovanny Suaza, 02-11-2026, 06:32 PM
            0 responses
            648 views
            0 likes
            Last Post Geovanny Suaza  
            Started by Geovanny Suaza, 02-11-2026, 05:51 PM
            0 responses
            369 views
            1 like
            Last Post Geovanny Suaza  
            Started by Mindset, 02-09-2026, 11:44 AM
            0 responses
            108 views
            0 likes
            Last Post Mindset
            by Mindset
             
            Started by Geovanny Suaza, 02-02-2026, 12:30 PM
            0 responses
            572 views
            1 like
            Last Post Geovanny Suaza  
            Started by RFrosty, 01-28-2026, 06:49 PM
            0 responses
            573 views
            1 like
            Last Post RFrosty
            by RFrosty
             
            Working...
            X