In the module Quant Trading Strategies and Models / Volume Reversal Strategy, the code for Strategy returns is:
data['str_return'] = data['return']*data['c_signal']
I don't understand why we don't use shift(1) to calculate the returns of the strategy as:
data['str_return'] = data['return']*data['c_signal'].shift(1)
It would make sense to me to strat generating the returns based on our positionning for the previous day. If at day 2, the signal switches to 1 ie BUY then I expect my first return to be on day 3 and equals to day3 returns * signal from day2.
## Strategy returns
It is now time to calculate the returns of the strategy by taking the product of return and its corresponding value in the column c_signal.
data['str_return'] = data['return']*data['c_signal']