Computation of the cumulative returns

In the course "Day trading strategies for beginners", In section 6, Unit 10, the cumulative returns are computed as: cumulative_strategy_returns = (data.strategy_returns+1).cumprod() but I would think that it should be computed as: strategy_returns = (data.strategy_returns+1).cumprod() - 1 (minus one). Do you agree with me ? If not, please could you provide me some explanations ?

Thanks and best regards

Hi there, 



Both approaches to calculate the cumulative returns are acceptable. If we use cumulative_strategy_returns = (data.strategy_returns+1).cumprod(), we will be able to calculate the total growth of the investment over time, i.e, the factor by which the investment has increased. If we choose to subtract one from it, we would obtain the percentage returns.

To illustrate the difference, let's consider an example with two successive returns: +10% and -5%. Using the first formula, the cumulative returns would be calculated as follows:

cumulative_strategy_returns = (1 + 0.1) * (1 - 0.05) - 1 = 0.045 = 4.5%

Using the second formula, the cumulative returns would be calculated as follows:

cumulative_strategy_returns = (1 + 0.1) * (1 - 0.05) = 1.045 = 104.5%

As you can see, the first formula yields the total percentage gain or loss (4.5%), while the second formula represents the investment's growth as a multiplier (104.5%).

You can use either of the two depending on your interpretation of cumulative returns.

Hope this helps. Please feel free to reach out in case any further clarification is required.

Thanks.