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 Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    569 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    330 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    548 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    548 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X