Annual Returns from Daily Prices and Price-versus-Total Return
Summary
The document explains two ways to calculate an annual return from daily prices: compute the simple return over a date interval, or compound each daily return by multiplying one plus each return and subtracting one. It also mentions log price differences as a return measure. The annual calculation should use the observations for the year, with care around the actual available trading dates rather than assuming January 1 is a market session.
Different published figures may reflect different assets or return definitions. The S&P 500 index is generally quoted as a price index, while SPY is an investable ETF whose adjusted prices reflect distributions and costs. Dividend treatment, reinvestment assumptions, fund fees, and taxes can therefore make its return differ from the index’s price change. The discussion gives no full data-handling specification for missing sessions or exact calendar-year boundaries, so those choices need to be made consistently.
Key ideas
- Annual simple returns can be computed by compounding daily returns across the year.
- A log price difference provides another way to express a return over an interval.
- Compare like with like: index price returns and ETF total returns include different components.
- Dividends, reinvestment assumptions, fees, and taxes affect realized investment returns.
Tags
Full text
# How to calculate annual returns from daily prices?
# How to calculate annual returns from daily prices?
Suppose I have daily adjusted closing prices for SPY, for example from yahoo finance. How from this calculate annual return?
Note: It's NOT about issues like 1.2 means 20% or 0.2 means 20%.
The most trivial solution is:
```
(adj. closing price at 31.12)/(adj. closing price at 1.1)
```
But:
- Result is different from the data appears on the web.
- The data appears on the web is not adequate. For example from here 2014 return was 11.39%, but from here it's 13.46% (This first result on Google so I suppose it's reasonable resource). Same one can find clicking other web sites...
Thanks,
## Answer by Vortex (score 1, accepted)
https://quant.stackexchange.com/a/31278
My formula example does not include cash dividend, management fees (ie. SPY), holding taxes.
Daily %=(px[i]-px[i-1])/px[i-1], where px[i] today and px[i-1] is yesterday.
Annual %=(daily[Jan 1st]+1)*(daily[Jan 2nd]+1)....about 252 days terms)-1.
In Java, you could use this function. Pass in a daily time-series of returns.
```
public static List<Tuple2<LocalDate,Double>> calcAnnualReturns(List<LocalDate> date, List<Double> values) {
List<Tuple2<LocalDate,Double>> list = new ArrayList<>();
int lastYear=-1;
BigDecimal tally=BigDecimal.ZERO;
if( values.size()>0 ) {
for (int i = 0; i < values.size(); i++) {
LocalDate ldt=date.get(i);
double value=values.get(i);
if( i==0 ) {
tally=BigDecimal.valueOf(value+1);
}else{
if( ldt.getYear()>lastYear ) {
// calculate
tally=tally.subtract(BigDecimal.ONE);
// add result
list.add(new Tuple2(LocalDate.of(lastYear, 12, 31), tally.doubleValue()));
// reset to new year
tally=BigDecimal.valueOf(value+1);
}else{
tally=tally.multiply(BigDecimal.valueOf(value+1));
}
}
//
lastYear=ldt.getYear();
}
// finish last value
tally=tally.subtract(BigDecimal.ONE);
list.add(new Tuple2(LocalDate.of(lastYear, 12, 31), tally.doubleValue()));
}
return list;
}
```
## Answer by simmy (score 3)
https://quant.stackexchange.com/a/24983
You can take the log difference: log(price_12-31-2014)-log(price_01-01-2014)
You can calculate the simple rate of return as: (price_12-31 - price_01-01)/price_01-01
## Answer by Alex C (score 2)
https://quant.stackexchange.com/a/24985
Apples and oranges.
S&P 500 index (your first link) is not the same as SPY (your second link) so the results of course need not be the same.
S&P 500 is a statistical index published by Standard and Poors, it is generally given as price change only, although as a supplement a total return version is available from Wilshire and others; these TR figures differ slighlty from each other depending on how you assume dividends are reinvested. But if not otherwise specified S&P 500 is a price only (no dividends) figure.
SPY is an actual investable ETF which tracks the S&P 500 stocks. The shareholders of SPY collect both price change and dividends, which are distributed once a quarter. Also some modest fees are subtracted. The return on SPY is a good measure of achievable total return including realistic costs.
So it is not surprising that your second figure is about 2% higher than the first: the dividend yield on American stocks is about 2%!Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.