Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is it possible to get the realized profit/loss per instrument?

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

    Is it possible to get the realized profit/loss per instrument?

    I'd like to show the realized profit/loss per instrument in my indicator.
    However, I don't see another method than the Account.Get() to query the realized P/L.
    And that gives me the P/L over all instruments.
    Is there another method?

    #2
    Hello wjadevries,

    Thanks for the post.

    Using the account directly you would not have access to a specific instruments Realized PnL, the account value would represent the total account PnL. If you were to want Unrealized PnL you could do that using the Positions collection and each positions GetUnrealizedProfitLoss method.

    You could potentially collect all of the individual trades for an instrument and build a trade collection with that data. https://ninjatrader.com/support/foru...797#post838797


    I look forward to being of further assistance.
    Last edited by NinjaTrader_Jesse; 10-07-2020, 09:39 AM.

    Comment


      #3
      Unfortunately it seems I don't have access to the SystemPerformance.AllTrades from within the indicator.
      a compilation error states that there is no object reference.

      Comment


        #4
        Hello wjadevries,

        Thanks for the clarification. The Account.Get is a strategy method which is why I had replied with the strategy way. In an indicator if you are using the addon methods to access the account you would only have the execution information. In that case you would not be able to build a trade collection as it takes Trades and you only have executions. I am not aware of a documented or supported way from an addon to build the trade collection in the same way a Strategy but you could try this community members solution: https://ninjatrader.com/support/foru...93#post1091093

        I look forward to being of further assistance.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        669 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        378 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        111 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