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 sjsj2732, Yesterday, 04:31 AM
    0 responses
    30 views
    0 likes
    Last Post sjsj2732  
    Started by NullPointStrategies, 03-13-2026, 05:17 AM
    0 responses
    286 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    282 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    132 views
    1 like
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    90 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Working...
    X