Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

PnL of open trade

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

    PnL of open trade

    How can I go about getting the unrealized PnL of one specific open trade created via a strategy? I assume I'd have to use the trade tag or the Order variable, but I'm not sure of the method to use.

    I've used this before - SystemPerformance.AllTrades[SystemPerformance.AllTrades.Count - 1].ProfitCurrency

    However, this only gets the realized PnL of the most recent trade once it's already closed out.

    Thanks.


    #2
    Hello sjeffblack,

    Thank you for your note.

    You can get the unrealized pnl of an open position in a strategy using Position.GetUnrealizedProfitLoss():



    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Thanks Kate. That seems to get the unrealized PnL for ALL open positions though. What if I have multiple open positions at the same time, and I need to get the unrealized PnL of one particular trade?

      Comment


        #4
        Hi Kate. Please ignore the last question. I have what I need. Thanks.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by CarlTrading, 03-31-2026, 09:41 PM
        1 response
        43 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 04-01-2026, 02:41 AM
        0 responses
        21 views
        0 likes
        Last Post CarlTrading  
        Started by CaptainJack, 03-31-2026, 11:44 PM
        0 responses
        30 views
        1 like
        Last Post CaptainJack  
        Started by CarlTrading, 03-30-2026, 11:51 AM
        0 responses
        50 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 03-30-2026, 11:48 AM
        0 responses
        40 views
        0 likes
        Last Post CarlTrading  
        Working...
        X