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.
    JesseNinjaTrader Customer Service

    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 geddyisodin, Today, 05:20 AM
        1 response
        11 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by Max238, Today, 01:28 AM
        3 responses
        32 views
        0 likes
        Last Post Max238
        by Max238
         
        Started by timko, Today, 06:45 AM
        2 responses
        13 views
        0 likes
        Last Post NinjaTrader_ChristopherJ  
        Started by habeebft, Today, 07:27 AM
        0 responses
        6 views
        0 likes
        Last Post habeebft  
        Started by Tim-c, Today, 03:54 AM
        1 response
        8 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Working...
        X