Course Name: Momentum Trading Strategies, Section No: 14, Unit No: 10, Unit type: Notebook
Hello,
I believe there is a mistake in this line of code since it does not remove the last line of hold_returns that is NaN.
stocks_returns = hold_returns[lookback_days::hold_days] * \
lookback_signal[::hold_days]
The code should be this one:
stocks_returns = hold_returns[lookback_days:-1:hold_days] * \
lookback_signal[::hold_days]
Am I correct?
Best,
Raimondo