• 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 moyerchopra, Yesterday, 11:43 PM
        0 responses
        1 view
        0 likes
        Last Post moyerchopra  
        Started by ttodua, Yesterday, 11:40 PM
        0 responses
        1 view
        0 likes
        Last Post ttodua
        by ttodua
         
        Started by edmata1109, 12-04-2019, 09:19 PM
        8 responses
        28 views
        0 likes
        Last Post koganam
        by koganam
         
        Started by maindoor, 12-03-2019, 10:45 PM
        9 responses
        63 views
        0 likes
        Last Post koganam
        by koganam
         
        Started by w0lverine, Yesterday, 08:22 PM
        0 responses
        1 view
        0 likes
        Last Post w0lverine  
        Working...
        X