Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to get current instrument name in Performance Metrics class?

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

    How to get current instrument name in Performance Metrics class?

    Hey there everyone,

    Is there a way on how to get the current instrument name? If there is, what is the code for that? I tried looking for relevant information in Performance Metrics section in NinjaTrader8 documentation but apparently, there's no information about Instrument name being called in Performance Metrics class.
    Attached Files

    #2
    Hi, thanks for posting.

    OnAddTrade() has a Trade object given to it e.g. Print(trade.Entry.Instrument); This would be the only place the Instrument can be read in a performance metric script.

    Kind regards,
    -ChrisL

    Comment


      #3
      Hey NinjaTrader_ChrisL,

      Thank you! Also, one more question. Is it possible to get the current instrument name and put it in DisplayAttirbute's Name? I tried doing it but it says that Name in DisplayAttribute should be static or constant.
      Attached Files

      Comment


        #4
        Hi, thanks for your reply.

        The declarations are defined at compile time, so that will not be possible.

        Kind regards,
        -ChrisL

        Comment


          #5
          Hello NinjaTrader_ChrisL,

          Oh okay, that's fine. Thanks again NinjaTrader_ChrisL

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          579 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          334 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          101 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          554 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          551 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X