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 Mindset, Today, 06:46 AM
        0 responses
        9 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, Yesterday, 05:21 PM
        0 responses
        14 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        15 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        82 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        48 views
        0 likes
        Last Post PaulMohn  
        Working...
        X