Kerry Back
Let’s compute close-to-close daily stock returns. Let \(P_t\) denote the price at close on day \(t\).
If no dividends, the gain on day \(t\) is \(P_t - P_{t-1}\).
The return per $1 invested in a share at close on \(t-1\) is
\[(P_t - P_{t-1}) / P_{t-1}\]
Chevron Corporation (CVX) will begin trading ex-dividend on August 18, 2021. A cash dividend payment of $1.34 per share is scheduled to be paid on September 10, 2021. Shareholders who purchased CVX prior to the ex-dividend date are eligible for the cash dividend payment.
Three Dates:
If you buy on Aug 18, you are not entitled to the dividend.
Purchase Aug 17 or before (and hold through Aug 17)
Why Aug 17 → Aug 19?
\[
(1+r_1)(1+r_2)...(1+r_T)-1
\]
If a company does an \(n\)-for-1 stock split, then each shareholder gets \(n\) new shares for each of her existing shares. Shares are worth roughly \(1/n\) as much.
Data vendors routinely compute split-adjusted prices, scaling down old prices by the same factor for comparability to new prices.
finance.yahoo.com is a good source for data.
Yahoo’s adjusted closing prices are adjusted for splits and also adjusted for dividends on each ex date.
On Aug 18, 2021, the Aug 17 price was adjusted as
\[ {\hat{P}_{\text{Aug17}}}={P_{\text{Aug17}}}-1.34 \]
\[ {\hat{P}_{\text{Aug17}}}/{P_{\text{Aug17}}} \]
\[ \frac{\hat{P}_{t}}{\hat{P}_{t-1}}=\frac{P_{t}}{P_{t-1}}=1+r_t \]
\[ \frac{P_{t}}{P_{t-1}-D_t} - 1 \]
The return calculated the usual way is:
\[ \frac{P_{\text{Aug18}}+1.34}{P_{\text{Aug17}}} - 1 =-0.0267 \]
The % change in Yahoo’s adjusted close is
\[ \frac{P_{\text{Aug18}}}{P_{\text{Aug17}}-1.34} - 1=-0.0271 \]
Install pandas-datareader or, on colab, upgrade it.
Can get monthly or annual return as % change in monthly or annual Yahoo-adjusted closing prices - equivalent to compounding Yahoo daily returns.
price = pdr('cvx', 'yahoo', start=2010)['Adj Close']
ret_monthly = price.resample('M').last().pct_change()
ret_annual = price.resample('Y').last().pct_change()
# change datetime to monthly or annual (optional)
ret_monthly.index = ret_monthly.index.to_period('M')
ret_annual.index = ret_annual.index.to_period('Y')