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
    }
    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 kinfxhk, 07-14-2026, 09:39 AM
        0 responses
        123 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 10:18 AM
        0 responses
        104 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 09:50 AM
        0 responses
        82 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-13-2026, 07:21 AM
        0 responses
        102 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Started by kinfxhk, 07-11-2026, 02:11 AM
        0 responses
        83 views
        0 likes
        Last Post kinfxhk
        by kinfxhk
         
        Working...
        X