Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    Gaby V.NinjaTrader Customer Service

    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 llanqui, Today, 03:53 AM
        0 responses
        6 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by burtoninlondon, Today, 12:38 AM
        0 responses
        10 views
        0 likes
        Last Post burtoninlondon  
        Started by AaronKoRn, Yesterday, 09:49 PM
        0 responses
        15 views
        0 likes
        Last Post AaronKoRn  
        Started by carnitron, Yesterday, 08:42 PM
        0 responses
        11 views
        0 likes
        Last Post carnitron  
        Started by strategist007, Yesterday, 07:51 PM
        0 responses
        14 views
        0 likes
        Last Post strategist007  
        Working...
        X