Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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 alifarahani, Today, 09:40 AM
        6 responses
        27 views
        0 likes
        Last Post alifarahani  
        Started by Waxavi, Today, 02:10 AM
        1 response
        17 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by Kaledus, Today, 01:29 PM
        5 responses
        13 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by Waxavi, Today, 02:00 AM
        1 response
        12 views
        0 likes
        Last Post NinjaTrader_LuisH  
        Started by gentlebenthebear, Today, 01:30 AM
        3 responses
        17 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Working...
        X