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 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