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 Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        664 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        376 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        110 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        575 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        580 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X