Hello Quantopians. I will be posting a series of posts for my Investment Strategies class at the university. Today's task is a line plot of cumulative overnight returns of QQQ. Please feel free to comment, correct any mistakes or make any suggestions.
@ Michael Matthews is correct. The current implementation is calculating todays return (ie today's close to today's open) . Maybe take a look at the pandas 'shift' method (https://pandas.pydata.org/pandas-docs/version/0.18/generated/pandas.Series.shift.html). You can shift yesterday's close price forward one day. Then compare that value to today's open.
The other issue you have is summing arithmetic returns. That doesn't really work. If one has a 1% gain followed by a 1% loss then it would appear the net gain would be 0%. However, it's really a bit less (1 + .01) x (1 - .01) = .9999. The more correct way is to use log returns.
I'll second @ Vladimir. Nothing like a backtest.