Exact calculation of Long Trades Drawdown in a long & short backtest report?

Please see the attached backtest reports. Both use the same code. Both have the same strategy input and Amibroker settings. The only difference is the one on the left has both longs and shorts enabled, whereas the one on the right is long only.

How can the max system % drawdown in the “Long trades” column be -99.87% in the long & short report, while it is only -18.57% in the long only report? The difference in number and performance of long trades is negligible in both reports and does not explain the incredible difference in the max system DD figure for longs. That can be seen by the number and performance of longs on these reports. I have also examined the long trades in both reports one by one and have confirmed this.

I understand that max system % drawdown is simply the largest peak to valley percentage decline in portfolio equity. But how exactly is this figure calculated for only the long trades in a long & short strategy report?

The backtests trade one instrument only and therefore is only in one trade at a time. These tests assume trade size of 80% of equity. The number of max consecutive long losers is 2 and there is a 10% stop loss on long trades. I know it’s still possible to have a nearly 100% DD but that’s highly unlikely.


Position Size is 80% of the current available Equity,.
So obviously those huge profits from Short trades (80% of current available "Initial Equity + Profits") shall be invested whenever there arises a "Long opportunity".
And when the Trade Size is more , Profits/ Losses Size too is more.
Hope you will figure out the rest, everything is there in front of you in Black and Green. :grinning:

1 Like

Its not the right way to test a system, especially with 80% Equity per trade as just one sample.

Also, when you haven't shared the code, you're just leaving the rest to guessing games.
An explanation can be sought from the procedure, not a selective result.

No details about the Symbol trend etc among other important things that you are missing.

A long only system in uptrend will be far different from a period in a downtrend.
That doesnt matter if its 100 trades or 1000 in the same period.

1 Like

I don't actually know the answer to this question, but my guess is that you would simply create a new "long only" equity curve by doing the following:

  1. Start with the initial equity, $100K in your example
  2. Apply the % P/L from each long trade, ignoring all short trades
  3. Calculate DD stats from the new equity curve

It should be straightforward to do this exercise yourself in Excel to see if your results match what's in the backtest report. Even with only 2 consecutive losses, it's fairly easy to imagine a large DD when this pattern occurs: 2 large losses, 1 small gain, 2 large losses, 1 small gain, etc.

1 Like

@mradtke we did this. As you can see in this snapshot I've sorted by first side (Long/Short), and then by entry date to pull all of the longs to the top in trade order. You can see that no string of losses for just the longs could have amounted to a 99% drawdown, which is why we are asking how is the backtest report calculating long only drawdown in a long/short strategy. It really seems like it is also including short trades. But that doesn't make sense given the label Long Drawdown.


What if you apply the $ P/L instead of % P/L to create the equity curve. Just eyeballing it, it appears you go pretty close to 0 around 6/17/2013.

1 Like