Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How does Strategy Analyzer calculate relative cumulative profit?

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

    How does Strategy Analyzer calculate relative cumulative profit?

    Dear NinjaTraders,

    I am trying to figure out how Strategy Analzyer is calculating cumulative profit. I am using a multi-instrument strategy, which is why this question is more difficult than it might appear.

    Here is the setup:
    V - initial account value
    Ea, Eb, Ec: entry prices for stocks A, B, C
    Xa, Xb, Xc: exit prices for stocks A, B, C
    Na, Nb, Nc: quantities traded for stocks A, B, C

    Now assume that I am trading as follows:
    Na = V/3/Ea
    Nb = V/3/Eb
    Nc = V/3/Ec

    I will have the following profit:
    P = Na * (Xa - Ea) + Nb * (Xb - Eb) + Nc * (Xb - Ec)

    The relative cumulative profit should therefore be:
    Pr = P / V

    Of course the backtester does not know what V was, so there is a difficulty in specifying this. This is where AccountSize *should* come in, but NinjaTrader ignores that during backtesting.

    What I can see from the Strategy Analyzer's summary page is that my strategy was resulting in $4,751.66 of total net profit. My original account value was $20,000 - resulting in a relative cumulative profit of $4,751.66 / $20,000 = 23.8%

    What Strategy Analyzer is reporting is 165.41%. I have no idea how it created that number and what I notice is that this number does not change, regardless of the initial account value I set inside my strategy. What I feel might be happening, is that it relative profit is calculated per trade as follows:
    (Xa - Ea) / Ea * (Xb - Eb) / Eb * (Xc - Ec) / Ec

    Unfortunately, this is of no use to me. I need relative cumulative profit as well as all reports in Strategy Analyzer referenced to my initial account value.

    Questions:
    * can you please explain/confirm to me, how the Strategy Analyzer calculates cumulative profits?
    * is there any way to change that behavior?

    I am seeing much more issues in creating a multi-instrument strategy with NinjaTrader's. Is my use-case something you were not targeting with NinjaTrader?

    Thank you,
    best regards, Felix

    #2
    Hello Felix,

    Thank you for your post

    The cumulative profit is a weight of the percent profit.

    Consider you start with $1 and you made 3 trades at profits of 25 cents, 50 cents, and 75 cents. That would mean the trade's percent profit was 25%, 50%, and 75%. What % mode does is it weighs each of these percentages in from a reinvestment standpoint.

    Trade 1 = 25%. 25% of $1 = we made 25 cents.
    Trade 2 = 50%. 50% of $1 + $0.25 = 50% of $1.25 = $0.625
    Trade 3 = 75%. 75% of $1.25 + $0.625 = 75% of $1.875 = $1.40625

    This means after all 3 trades we would have made $0.25 + $0.625 + $1.40625 = $2.28125.
    Since we started with $1, winnings of $2.28125 is equivalent to a Cum. Profit % of 228.125%

    You can see that 228% cumulative profit is not equivalent to Total Net Profit which is just $1.50 or 150% if taken from a summation only standpoint.

    Let me know if this helps explain it.
    Cal H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Jon17, Today, 04:33 PM
    0 responses
    1 view
    0 likes
    Last Post Jon17
    by Jon17
     
    Started by Javierw.ok, Today, 04:12 PM
    0 responses
    6 views
    0 likes
    Last Post Javierw.ok  
    Started by timmbbo, Today, 08:59 AM
    2 responses
    10 views
    0 likes
    Last Post bltdavid  
    Started by alifarahani, Today, 09:40 AM
    6 responses
    41 views
    0 likes
    Last Post alifarahani  
    Started by Waxavi, Today, 02:10 AM
    1 response
    21 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Working...
    X