Hello, when we calculate the returns of a strategy, I noticed we add 1. Why do we do this?
example:
Cumulative Strategy Returns
cumulative_strategy_returns = (data.strategy_returns+1).cumprod()
Hello, when we calculate the returns of a strategy, I noticed we add 1. Why do we do this?
example:
cumulative_strategy_returns = (data.strategy_returns+1).cumprod()
Hello Dennis,
It does not just returns its cumulative returns.
For example, say you invest $1 on AAPL. It goes up by 0.2% on the first day after buying and then the next day goes down by 0.1%.
What will have after the first day?
You will have that $1 you already had plus you'll have 0.2% of what you already had which is $1 x 0.2. Makes a total of $1 + $1 x 0.2 = $1 x (1 + 0.2) = $1.2
What will you have at the end of the 2nd day?
You will have that $1.2 you already had plus you'll have 0.1% less of of what you already had which is $1.2 x 0.1. Makes a total of $1.2 - $1.2 x 0.1 = $1.2 x (1 - 0.1) = $1.08.
This could have been done directly as well as for two days together:
$1 x (1 + 0.2) x (1-0.1) = $1.08
This is exactly what the code data.strategy_returns+1 is doing adding 1 to the positive and negative percentage changes of the strategy and the multiplying them.
Thank you Akshay :)