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

Additonal data series: Daily -AND- RTH bars?

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

    Additonal data series: Daily -AND- RTH bars?

    The examples from the documentation:

    Code:
    AddDataSeries(string instrumentName, BarsPeriodType periodType, int period)
    AddDataSeries(string instrumentName, BarsPeriodType periodType, int period, MarketDataType marketDataType)
    AddDataSeries(string instrumentName, BarsPeriod barsPeriod)
    AddDataSeries(string instrumentName, BarsPeriod barsPeriod, string tradingHoursName)
    AddDataSeries(string instrumentName, BarsPeriod barsPeriod, string tradingHoursName, bool? isResetOnNewTradingDay)
    AddDataSeries(string instrumentName, BarsPeriod barsPeriod, int barsToLoad, string tradingHoursName, bool? isResetOnNewTradingDay)​
    None of these seem to allow for this, but I'm sure I'm missing something.

    Can anyone reading this please help out? I've spent a lot more time on this than I care to admit.

    I'm trying to add a daily RTH data series to my primary strategy that already has a couple of additional data series. This would be BarsArray[3] if I could get it up and running. I've tried 1440m and a few other things but I wanted to ask for help before I waste any more precious Sunday time.

    #2
    Hello WalterSkinner,

    Day bars cannot have trading hours template applied. These come fully formed from the data provider.

    If you want to specify a trading hours template use minute bars (like 1440 minute to represent 1 day).

    The overloads with the tradingHoursName would be the name of the template you want to apply.
    AddDataSeries(string instrumentName, BarsPeriod barsPeriod, string tradingHoursName)

    For example if the instrument was the ES 03-23, the RTH template for this would be 'CME US Index Futures RTH'.

    AddDataSeries(null, new BarsPeriod() { BarsPeriodType = BarsPeriodType.Minute, Value = 1440 }, "CME US Index Futures RTH");

    Note from the help guide:
    "If your NinjaScript object is using AddDataSeries() allowing to specify a tradingHoursName, please keep in mind that: An indicator / strategy with multiple DataSeries of the same instrument will only process realtime OnBarUpdate() calls when a tick occurs in session of the trading hour template of all added series. Any ticks not processed will be queued and processed as a tick comes in for all subsequent DataSeries."


    This warning is letting you know, data will only be processed when all series are in session (and will be queued until then).
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by judysamnt7, 03-13-2023, 09:11 AM
    4 responses
    53 views
    0 likes
    Last Post DynamicTest  
    Started by ScottWalsh, Today, 06:52 PM
    4 responses
    33 views
    0 likes
    Last Post ScottWalsh  
    Started by olisav57, Today, 07:39 PM
    0 responses
    5 views
    0 likes
    Last Post olisav57  
    Started by trilliantrader, Today, 03:01 PM
    2 responses
    19 views
    0 likes
    Last Post helpwanted  
    Started by cre8able, Today, 07:24 PM
    0 responses
    6 views
    0 likes
    Last Post cre8able  
    Working...
    X