Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Bars.Instrument.InstrumentType

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

    Bars.Instrument.InstrumentType

    I am developing an indicator that will be used with many different instrument types like futures, stocks, forex....

    If I use the following syntax will that catch all possibilities.

    Code:
     TickSize=Bars.Instrument.MasterInstrument.TickSize;
    or should I use this
    Code:
    if(Instrument.MasterInstrument.InstrumentType == InstrumentType.Future)
       TickSize=Bars.Instrument.MasterInstrument.TickSize;
                
     if(Instrument.MasterInstrument.InstrumentType == InstrumentType.Stock)
    TickSize=0.01;
                
     if(Instrument.MasterInstrument.InstrumentType == InstrumentType.Currency)
    TickSize=0.0001;

    #2
    blar - Those are a few of the types, also Index included.

    TickSize is a (provided) instrument level property already designed to return the TickSize of the instrument the script is applied to. You don't have to assign it a value in order to use.
    Ryan M.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    574 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    333 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    101 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    553 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    551 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X