January 2019
Intermediate to advanced
378 pages
8h 27m
English
The overnight returns were better than the intraday returns, but how about the volatility? Returns are always judged on a risk-adjusted basis, so let's see how the overnight trades compared to the intraday trades on the basis of their standard deviation.
We can use NumPy to calculate this for us as follows:
np.std(spy['Daily Change'])
This generates the following output:

spy['Overnight Change'] = pd.Series(spy['Open'] - spy['Close'].shift(1)) np.std(spy['Overnight Change'])
This generates the following output:

Read now
Unlock full access