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 charlesugo_1, 05-26-2026, 05:03 PM
        0 responses
        59 views
        0 likes
        Last Post charlesugo_1  
        Started by DannyP96, 05-18-2026, 02:38 PM
        1 response
        143 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by CarlTrading, 05-11-2026, 05:56 AM
        0 responses
        161 views
        0 likes
        Last Post CarlTrading  
        Started by CarlTrading, 05-10-2026, 08:12 PM
        0 responses
        97 views
        0 likes
        Last Post CarlTrading  
        Started by Hwop38, 05-04-2026, 07:02 PM
        0 responses
        283 views
        0 likes
        Last Post Hwop38
        by Hwop38
         
        Working...
        X