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 SalmaTrader, 07-07-2026, 10:26 PM
    0 responses
    38 views
    0 likes
    Last Post SalmaTrader  
    Started by CarlTrading, 07-05-2026, 01:16 PM
    0 responses
    20 views
    0 likes
    Last Post CarlTrading  
    Started by CaptainJack, 06-17-2026, 10:32 AM
    0 responses
    14 views
    0 likes
    Last Post CaptainJack  
    Started by kinfxhk, 06-17-2026, 04:15 AM
    0 responses
    20 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Started by kinfxhk, 06-17-2026, 04:06 AM
    0 responses
    22 views
    0 likes
    Last Post kinfxhk
    by kinfxhk
     
    Working...
    X