Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

get MarketDataType in initialize()

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

    get MarketDataType in initialize()

    I am wondering how we can get MarketDataType of primary bar so that we can add secondary bar with the same Market Data Type.

    I want to achieve the following code:

    MarketDataType_x = getMarketDataType(primary bar);

    Add("ES 06-10", PeriodType.Minute, 1, MarketDataType_x );

    #2
    Hello microsat,

    Thank you for writing in. You would use the following:
    Code:
    BarsPeriod.MarketDataType
    Please see our help guide document on working with the BarsPeriod object: http://ninjatrader.com/support/helpG...sub=barsperiod

    The BarsPeriod object should not be accessed inside the Initialize() method as it may not be completely built when the Initialize method is called. If you need to use it inside the Initialize() method I recommend implementing a null reference check.

    Please let me know if I may be of further assistance.
    Michael M.NinjaTrader Quality Assurance

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by CarlTrading, 03-31-2026, 09:41 PM
    1 response
    142 views
    1 like
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 04-01-2026, 02:41 AM
    0 responses
    81 views
    1 like
    Last Post CarlTrading  
    Started by CaptainJack, 03-31-2026, 11:44 PM
    0 responses
    125 views
    2 likes
    Last Post CaptainJack  
    Started by CarlTrading, 03-30-2026, 11:51 AM
    0 responses
    119 views
    1 like
    Last Post CarlTrading  
    Started by CarlTrading, 03-30-2026, 11:48 AM
    0 responses
    98 views
    0 likes
    Last Post CarlTrading  
    Working...
    X