• 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

Check for instrument type

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

    Check for instrument type

    Hello. How to ckeck what instrument?
    For example if(instrument==MSFT) do something

    #2
    Hello alexstox,

    You may use "Instrument.MasterInstrument.Name".

    Code:
    if (Instrument.MasterInstrument.Name == "MSFT")
    {
        // Do something for Microsoft
    }
    http://www.ninjatrader.com/support/h...trument_na.htm
    JCNinjaTrader Customer Service

    Comment


      #3
      To check for type this will be like this?
      Code:
      if (Instrument.MasterInstrument.InstrumentType==InstrumentType.Stock)
      {do something for stocks}

      Comment


        #4
        Hello alexstox,

        Correct.
        JCNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by ballboy11, Today, 02:01 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by cutzpr, Today, 02:01 PM
        1 response
        9 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by mcjosejavier, Today, 10:04 AM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by odeifuor, Today, 09:05 AM
        3 responses
        10 views
        0 likes
        Last Post NinjaTrader_Kate  
        Started by jhontorres, Today, 12:16 PM
        1 response
        10 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X