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 marthaviliyam, Today, 09:58 PM
        0 responses
        1 view
        0 likes
        Last Post marthaviliyam  
        Started by herbalgrown1, Today, 09:57 PM
        0 responses
        1 view
        0 likes
        Last Post herbalgrown1  
        Started by StephenSearle, Today, 09:03 PM
        0 responses
        4 views
        0 likes
        Last Post StephenSearle  
        Started by Azmoewewc, Today, 08:15 PM
        0 responses
        8 views
        0 likes
        Last Post Azmoewewc  
        Started by voltation, Today, 04:32 PM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_ShawnB  
        Working...
        X