Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

What am I doing wrong with pos.Instrument?

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

    What am I doing wrong with pos.Instrument?

    Hi guys,

    When printing pos.Instrument I am getting "EURUSD Default" returned instead of "EURUSD".

    Is this expected?

    Cheers,
    Shane

    #2
    Hello,

    I wanted to check, if this is an Instrument object, are you printing the Instrument object its self or the Name property?

    Based on the sample, it would seem you may be just printing the object its self which would likely result in what you are seeing.

    Could you instead try :

    pos.Instrument.FullName


    I look forward to being of further assistance.

    Comment


      #3
      Great thanks for the quick help on that one Jesse.

      pos.Instrument.FullName corrected the issue.

      Cheers!
      Shane

      Comment


        #4
        Originally posted by ShaneAU View Post
        Hi guys,

        When printing pos.Instrument I am getting "EURUSD Default" returned instead of "EURUSD".

        Is this expected?

        Cheers,
        Shane
        Instrument a tradeable object, which an instance object of the master instrument. Including the exchange (for forex, there is a default exchange)

        You either want Instrument.FullName or Instrument.MasterInstrument.Name. Either will work for Forex, but your requirements may change for other assets.

        Instrument: ES 06-16 Globex
        Instrument.FullName: ES 06-16
        Instrument.MasterInstrument.Name: ES

        Instrument: AUDUSD Default
        Instrument.FullName: AUDUSD
        Instrument.MasterInstrument.Name: AUDUSD

        Instrument: AAPL NASDAQ
        Instrument.FullName: AAPL
        Instrument.MasterInstrument.Name: AAPL
        MatthewNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CaptainJack, 05-29-2026, 05:09 AM
        0 responses
        246 views
        0 likes
        Last Post CaptainJack  
        Started by CaptainJack, 05-29-2026, 12:02 AM
        0 responses
        158 views
        0 likes
        Last Post CaptainJack  
        Started by charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        165 views
        1 like
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        250 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        201 views
        0 likes
        Last Post CarlTrading  
        Working...
        X