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 Mindset, 04-21-2026, 06:46 AM
        0 responses
        49 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by M4ndoo, 04-20-2026, 05:21 PM
        0 responses
        69 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by M4ndoo, 04-19-2026, 05:54 PM
        0 responses
        36 views
        0 likes
        Last Post M4ndoo
        by M4ndoo
         
        Started by cmoran13, 04-16-2026, 01:02 PM
        0 responses
        96 views
        0 likes
        Last Post cmoran13  
        Started by PaulMohn, 04-10-2026, 11:11 AM
        0 responses
        59 views
        0 likes
        Last Post PaulMohn  
        Working...
        X