Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

GetProfitLoss discrepancies

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

    GetProfitLoss discrepancies

    Hi,

    I'm using the following to print the trades profits/loss, but find that what's printed is less than what appears in executions and trades in account performance.

    Code:
    TradePL = Position.GetProfitLoss(Close[0], PerformanceUnit.Currency);
    
    DrawText(""+CurrentBar, Math.Round(TradePL,2).ToString(), 0, High[0] - (TickSize *10), Color.Yellow);
    Why the discrepancies?
    Thanks in advance

    #2
    Hello 2Look4me,

    Thank you for your post.

    This would only print out the values from the strategy's performance and not that of the entire account.

    Please let me know if you have any questions.

    Comment


      #3
      Hi Patrick,

      That I understand. But for instance; Buy: 951.2 Sell: 949 Account Performance= (224.30) and GetProfitLoss= (232.15) or Buy: 950.7 Sell: 949.2; Account Performance = (154.30) and GetProfitLoss= (152.15)

      Comment


        #4
        Hello,
        Do you have commissions factored in with your account performance trades?
        The GetProfitLoss() method is the unrealized PnL and would not include commissions if they are set up. Unrealized PnL is not factored into realized PnL until the trade is closed. The account performance only shows the performance of trades that have been closed, not positions you are in currently.
        Cody B.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        633 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        567 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X