Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Profit/Loss Question

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

    Profit/Loss Question

    Is this correct?

    To get the open position Realtime PnL I would use:
    Position.GetProfitLoss(Close[0], PerformanceUnit.Currency

    To get the closed position Realtime PnL I would use:
    Performance.RealtimeTrades.TradesPerformance.Curre ncy.CumProfit

    #2
    more info

    the reason I ask.....

    I have a exit statement that is supposed to exit all contracts when my open PnL > 2 points. Which you can see here that my print statement confirms while I am short 7 contracts, I have the 2 points.... So my system exits .75 lower than my last fill. But as you can see from the print statement, my profits disappeared, even though my exit was lower than the last print. This shouldn't be. What am I doing wrong with these PnL's?

    Here is a snipit from my print:
    9/8/2008 :: 9:58:0 LongCount: 119 , ShortCount: 126 MP: -7 FillPrice: 1265.25 Open PnL: $498 Closed PnL: $1297
    9/8/2008 :: 9:58:0 LongCount: 126 , ShortCount: 126 MP: 0 FillPrice: 1264.75 Open PnL: $0 Closed PnL: $1180

    Comment


      #3
      Yes, GetProfitLoss() returns the open PnL. Take note it is the PnL of the position not of any particular order.

      Yes, your realtime property will give you the closed PnL. Take note that this PnL will be calculated for ALL realtime trades. Not only the realtime trades of today. Please see this reference sample for ways to work around this: http://www.ninjatrader-support.com/v...ead.php?t=4084
      Josh P.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      580 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      335 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      102 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      554 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      552 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X