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