Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Failed to add a data series to my strategy

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

    Failed to add a data series to my strategy

    My primary data series is an ES06-11 233-tick-bar data series (i.e. BarsArray[0]). I tried to add an ES06-11 daily-bar data series by calling Add(PeriodType.Day, 1);in my Initialize()method as illustrated in the Ninja Trader help documentation.
    After adding the call Add(), the strategy no longer runs. Using Visual Studio debugger, I found that the strategy fails during the call to Add(). That is, it fails to return. Since the Add() returns a void, it does not return any error code and no exceptions are thrown.
    I presumed that a call to Add() would request a download of the data series from the broker, but I am unsure about that. So, I created a chart with both the tick data series and the daily data series on one chart and installed the strategy on the chart in the hope that the Add() method would now have the data series that it needed; however, this also failed.
    I installed the example strategy “SampleMultiTimeFrame” on an ES06-11 Daily chart thinking that orders would show up on the daily bars based on the 5-minute and 15-minute data series, but no orders are displayed.
    I do not know what else to try. I do not know what I am doing wrong. How do I add another data series to my strategy? Any help would be appreciated.

    #2
    seeker579, how much lookback days are you creating your charts with? Please ensure there are enough days loaded to satisfy the BarsRequired property for all involved series (normally this is defaulted to 20).

    Comment


      #3
      I load 15 days of tick-bar data in the chart that has thousands of bars.

      In the OnBarUpdate() method I have the following statements:

      // Checks to make sure we have at least 20 (default value of BarsRequired) or more bars in primary bars objects
      // and 3 (default value of AvgTrueRangeLen) in supplementary (daily) bars object before continuing.
      if (CurrentBars[0] < BarsRequired || CurrentBars[1] < AvgTrueRangeLen)
      return;

      However, this part of the code is never executed.

      Comment


        #4
        Thanks for the reply, please lower you BarsRequired setting then to 15 when you start up the strategy or load at least 20 days of data for the defaults, otherwise the OnBarUpdate() would not be called here.

        Comment


          #5
          Thanks Bertrand! The strategy is now working.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          647 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