The return over one period (day, week, month, etc.) for a stock is:
ret(t,t+1) = [P(t+1) + D(t+1) - P(t)] / P(t)
where P(t) is the stock price at the start of the period, P(t+1) is the stock price at the end of the period, and D(t+1) is the dividend paid at the end of the period.
If you're looking over a long enough period (e.g., year), you may have multiple dividends, in which case you can compute the IRR of your investment or the r such that the following is true.
P(0) = D(1) / (1+r) + D(2) / (1+r)^2 + ... + D(N) / (1+r)^N + P(N)
Unfortunately, this assumes that all of the dividends are reinvested at the same rate, r, which is highly unlikely.
Alternatively, you can follow the following recipe that is often used to compute the return on a coupon bond, which is also subject to reinvestment risk.
- compute the future value of each dividend at the time the stock is sold using the appropriate reinvestment rates for each dividend.
- Sum all of these future values.
- Divide this sum by the price at which the stock is purchased.
This will produce a holding period return that you can then annualize if you want.