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 algospoke, 04-17-2024, 06:40 PM
    5 responses
    46 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Started by arvidvanstaey, Today, 02:19 PM
    1 response
    4 views
    0 likes
    Last Post NinjaTrader_Zachary  
    Started by mmckinnm, Today, 01:34 PM
    3 responses
    5 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by f.saeidi, Today, 01:32 PM
    2 responses
    8 views
    0 likes
    Last Post f.saeidi  
    Started by alifarahani, 04-19-2024, 09:40 AM
    9 responses
    55 views
    0 likes
    Last Post NinjaTrader_Jesse  
    Working...
    X