Use cumsum() or cumprod() in calculating drawdown?

Course Name: Trading Alphas: Mining, Optimisation, and System Design, Section No: 23, Unit No: 7, Unit type: Notebook

# Calculate Maximum Drawdown
max_ddwn = (p.add(1).cumprod()-p.add(1).cumprod().expanding().max()).min()

In previous notebook “profit factor and drawdown”, it uses cumsum() when calculating drawdown. In this notebook, it uses cumprod(). Which one is better to illustrate the drawdown?

Hi,

Let me get back to you on this.

Hi,

The drawdown on cumprod is the drawdown of a compounding portfolio, while the drawdown with cumsum shows the same for a non-compounding portfolio. Both are valid; it depends on what investment style you are using. For most people, the actual drawdown will be somewhere in the middle as they compound but also take money out in regular intervals.