Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Check instrument type in AddDataSeries

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

    Check instrument type in AddDataSeries

    I can see in the NT8 help guide how to check the MasterInstrument instrument type. But, what if I want to check the instrument type of one added data series added using AddDataSeries?

    Thanks

    #2
    Hello guillembm,

    Thanks for your post.

    You can access through the BarsArray[n].Instrument.MasterInstrument.InstrumentType where n = the data series. Here is an example you can test with:

    Print ("BIP: "+BarsInProgress+" Type: "+BarsArray[BarsInProgress].Instrument.MasterInstrument.InstrumentType);

    Example output:
    BIP: 0 Type: Future
    BIP: 1 Type: Future
    BIP: 2 Type: Forex
    BIP: 0 Type: Future
    BIP: 1 Type: Future

    Reference: https://ninjatrader.com/support/help...rumenttype.htm
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by bmartz, 03-12-2024, 06:12 AM
    4 responses
    31 views
    0 likes
    Last Post bmartz
    by bmartz
     
    Started by Aviram Y, Today, 05:29 AM
    4 responses
    12 views
    0 likes
    Last Post Aviram Y  
    Started by algospoke, 04-17-2024, 06:40 PM
    3 responses
    28 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by gentlebenthebear, Today, 01:30 AM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by cls71, Today, 04:45 AM
    1 response
    7 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Working...
    X