Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Secondary Data Series question. Use Chart Trading Hours?

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

    Secondary Data Series question. Use Chart Trading Hours?

    Hi,

    I want to be able to control how many bars to load on secondary data series.

    I only found one syntax that allows for "barToLoad":

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

    I want it to copy the chart's instrumentName and tradingHoursName.

    I've used Instrument.MasterInstrument.Name for string instrumentName.
    Is there a similar code to grab the chart's currently selected tradingHoursName?

    p.s. question, the isResetOnNewTradingDay code, how exactly does that opperate?

    Thanks!

    #2
    Hello davydhnz,

    Thank you for your post.

    If you want the instrument and the trading hours to be the same on the added data series, you can use null for the values.

    IsResetOnNewTradingDay indicates if the bars series is using the Break at End Of Day data series property.



    Please let us know if you have any other questions.

    Comment


      #3
      NinjaTrader_Gaby

      I tried that

      AddDataSeries(null, (BarsPeriodType.Minute, 1440), 2, null, false);

      but how do I set Minute and period 1440?

      I want only load 2 bars

      Thank you.

      Comment


        #4
        Nevermind, I worked it out ‍*facepalm*
        Code:
        AddDataSeries(null, new BarsPeriod { BarsPeriodType = BarsPeriodType.Minute, Value = 15 }, 2, null, false);
        Thanks Gaby

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        637 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        366 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        107 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        569 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        571 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X