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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        63 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        91 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        48 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        105 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        63 views
        0 likes
        Last Post PaulMohn  
        Working...
        X