Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Instrument Code

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

    Instrument Code

    I am attempting to find a way to access the current instrument. So, if displaying Euro Futures, I would like to be able to access the "symbol for it" (e.g. 6Exx or whatever). If it is accessible, can it be accessed from initialize()?

    Also, I would like to be able to access the time frame that is displayed on the chart. I know that you can access the "tick value" with (this.TickSize)... Have been trying to find something similar like "BarTime". There is a "BarsPeriod", but it appears to only be relevant to certain indicators.

    Appreciate any help...

    Thank you.

    #2
    SharkCub, you can get the full name of an instrument (including the expiry) with this code:
    Code:
    string fullInstName = Instrument.FullName;
    If you just want the instrument name (no expiry):
    Code:
    string partName = Instrument.MasterInstrument.Name;
    There is no guarantee these properties will be accessible in the Initialize() section, due to the way it is called multiple times in the course of normal operations.

    BarsPeriod will give you everything you want to know about the bar type and duration. Please take a look at the help guide entry and let us know if you have any other questions.
    AustinNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    597 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    343 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    556 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    555 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X