• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

BarsPeriod.Id in NT 8?

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

    BarsPeriod.Id in NT 8?

    in NT7 when using multiple instruments in a script, the secondary bars were set to use the same period as the primary bars with this line:

    Code:
    Add(XYZ, BarsPeriod.Id, BarsPeriod.Value);
    However, BarsPeriod.Id is not valid in NT8. For NT8 can I accomplish the same thing using:

    Code:
    AddDataSeries(XYZ, BarsPeriod.BaseBarsPeriodType, BarsPeriod.Value);
    It works, but is this the correct way to do that or could I get some unwanted results in the future?

    #2
    Hello MM345,

    Officially dynamically adding series is not supported for NinjaTrader 7 or for NinjaTrader 8.

    From the help guide:
    "Arguments supplied to AddDataSeries() should be hardcoded and NOT dependent on run-time variables which cannot be reliably obtained during State.Configure (e.g., Instrument, Bars, or user input). Attempting to add a data series dynamically is NOT guaranteed and therefore should be avoided. Trying to load bars dynamically may result into an error similar to: Unable to load bars series. Your NinjaScript may be trying to use an additional data series dynamically in an unsupported manner."
    http://ninjatrader.com/support/helpG...dataseries.htm


    However, you would use BarsPeriod.BarsPeriodType and BarsPeriod.Value unless you are using a bar type that has underlying bars made from another bar type.
    http://ninjatrader.com/support/helpG...barsperiod.htm
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by yrch1985, 11-03-2019, 11:49 AM
    8 responses
    90 views
    0 likes
    Last Post aligator  
    Started by Dr3am, Today, 05:10 PM
    0 responses
    2 views
    0 likes
    Last Post Dr3am
    by Dr3am
     
    Started by imalil, Today, 04:28 PM
    0 responses
    3 views
    0 likes
    Last Post imalil
    by imalil
     
    Started by bboyle1234, Today, 03:47 PM
    0 responses
    1 view
    0 likes
    Last Post bboyle1234  
    Started by caveat_lector, Today, 03:46 PM
    0 responses
    7 views
    0 likes
    Last Post caveat_lector  
    Working...
    X