Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How do I compute the P&L of a strategy since the last flat position?

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

    How do I compute the P&L of a strategy since the last flat position?

    Hello,

    I was using

    SystemPerformance.AllTrades[SystemPerformance.AllTrades.Count - 1].ProfitCurrency

    to print the P&L of the strategy, but found out that if I had a partially filled order followed by a filled order, the system treated it as 2 trades, and therefore the P&L would only show the last trade (not including the partially filled). But what I really want is to print the P&L of the strategy from the last flat position and this flat position, how can I achieve that?
    Thanks,

    Billy

    #2
    Hello Billy,

    The trades being separated would be expected, and how this would be reported in the TradePerformance window.

    You could choose to track the PnL yourself, and reset this on each time the position is flat.

    Below is a link to an example named DailyLossLimitExample_NT8 that resets on a new session, which you could adapt to reset when the position is flat.
    Hello, I've updated the DailyLossLimit and DailyLosLimitMultiTrade examples that were posted on the forum for NinjaTrader 7 for NinjaTrader 8. These are often requested and I felt they are good examples to have for NT8. DailyLossLimitExample_NT7 - http://ninjatrader.com/support/forum...241#post451241 (http://ninjatrader
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Today, 05:17 AM
    0 responses
    52 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    130 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    70 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    43 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    47 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X