Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

AddDataSeries default values

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

    AddDataSeries default values

    Hi,

    im using this implementation for AddDataSeries:
    AddDataSeries(Data.BarsPeriodType.Second, 30);
    AddDataSeries(Data.BarsPeriodType.Minute, 2);
    AddDataSeries(Data.BarsPeriodType.Minute, 15);
    AddDataSeries(Data.BarsPeriodType.Minute, 60);​

    But i found that this loads all bars for each period DataSeries, but this does my indicator so slow when im adding it to my chart, i want to set the property barsToLoad trying to not load the full daysToLoad for my chart for each Dataseries, it is possible? i found this implementation on the documentation:
    AddDataSeries(string instrumentName, BarsPeriod barsPeriod, int barsToLoad, string tradingHoursName, bool? isResetOnNewTradingDay)

    But i dont know how to set the period vale for each new dataSeries and i dont know the default values for instrumentName (to take the chart instrument), tradingHoursName and isResetOnNewTradingDay

    It is possible?

    Thanks for your help

    #2
    Hello arbeydario,

    This overload signature is the correct one to use.
    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.

    Join the official NinjaScript Developer Community for comprehensive resources, documentation, and community support. Build custom indicators and automated strategies for the NinjaTrader platforms with our extensive guides and APIs.


    Use null for the instrument to default to the primary series Instrument.
    Use string.Empty for the tradingHoursTemplate to default to the primary series TradingHours.
    Use true for isResetOnNewTrading day if you want the Break at EOD enabled (a new bar is formed at the start of a new session).

    As an example:

    AddDataSeries(null, new BarsPeriod { BarsPeriodType = BarsPeriodType.Second, Value = 30), 864000, string.Empty, true);
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    43 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    25 views
    0 likes
    Last Post PaulMohn  
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    163 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    98 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    158 views
    2 likes
    Last Post CaptainJack  
    Working...
    X