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