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 CarlTrading, 03-31-2026, 09:41 PM
        1 response
        81 views
        1 like
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        42 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        64 views
        2 likes
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        66 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        54 views
        0 likes
        Last Post CarlTrading  
        Working...
        X