Computation of the equity curve and the CAGR based on the cumulative returns

Course Name: Backtesting Trading Strategies, Section No: 7, Unit No: 16, Unit type: Notebook

 

For the computation of the cumulative returns, I used to apply this formula: (1+ returns).cumprod() - 1 , but in the notebook the "-1" is dicarded. Could I compute the equity curve and the CAGR with my formula or should I use the formula provided in the notebook?

Thanks 

You are using the formula (1+returns).cumprod() - 1 to calculate the cumulative returns, which is correct considering you are scaling the values to start from 0 instead of 1 as in the notebook. However, the -1 at the end is not necessary, and it can actually be misleading when calculating the equity curve and the Compound Annual Growth Rate (CAGR).

The cumulative returns formula simply takes the product of all the daily returns, and then subtracts 1 to get the percentage change in the investment. However, if you subtract 1 from the cumulative returns, then the results can be negative for some periods. This can lead to incorrect results when calculating the CAGR.

Therefore, we recommend that you avoid using the -1 at the end of the cumulative returns formula. Instead, simply use (1+returns).cumprod() to calculate the cumulative returns and CAGR ahead. You can then calculate the equity curve and the CAGR using the correct formulas.

We hope this is helpful. Please let us know if you have any other questions.