Which mistakes turn a correct formula into a wrong return?
The formula for a return is a division. Every wrong return series in circulation was produced by a correct division applied to the wrong two numbers, and this lesson is the four ways that happens with API data, each measured.
The wrong column
/eod/ rows carry close and adjusted_close. Measured on 2026-09-04, SPY.US from 2 September 2016 to 3 September 2026 rose 254.1% on close and 315.7% on adjusted_close. The sixty-one points are ten years of dividends, and a return computed on close is the return of an investor who threw every dividend away. For a share that splits, the error is a fake crash: Apple's 2020 four-for-one split is a −75% "return" on close and nothing on adjusted_close. The raw-versus-adjusted lesson is the mechanism; the rule here is that every return statistic in this course is on adjusted_close, and the one exception — a signal that must use what was known on the day — is stated as an exception.
The wrong calendar
A return needs two rows, and a join between two symbols needs rows on the same dates. The US market traded on 250 days in 2025, measured on 2026-09-04; not 252, because a holiday fell where the round number does not expect one. BTC-USD.CC trades 365. EURUSD.FOREX trades on days the New York exchange is shut. Join a share to Bitcoin by row number and the dates drift apart within a month; join by date and drop the days only one side has, and the return pairs are real. Never fill a missing day with the previous value for a return computation: a filled day is a zero return that the market did not produce, and it lowers every volatility and correlation it touches.
The wrong gap
A daily return across a weekend is a return over three calendar days and one trading day. For volatility that is the convention — trading days, √252 — and it is fine as long as it is consistent: annualise crypto by √365 and shares by √252, and never compare the two without saying so. Bitcoin's daily standard deviation of 3.49% over ten years to 3 September 2026 annualises to 67% by √365; the same number annualised by √252 would read 55%, and both appear in print.
The wrong direction of time
The adjustment loop rewrites adjusted_close backwards. A return series computed today on adjusted data is correct as a record of what a holder earned — and different from the same series computed a year ago, because a dividend paid since then has shifted every earlier adjusted close down by a factor. The reproducibility lesson is why a stored return series and a freshly computed one disagree in the fourth decimal, and why the disagreement is not an error.
The check
One habit catches most of it. Before computing anything on a return series, print its five largest and five smallest values with their dates and look at them. A −75% on a split date is the wrong column; a string of exact zeros is a filled calendar; a +40% on a day nothing happened is a bad join. The five worst days of SPY.US over twenty years — 16 March 2020 at −10.9%, 15 October 2008 at −9.8%, 12 March 2020, 1 December 2008, 29 September 2008 — are all days the world remembers. A return series whose extremes are days nobody remembers is a return series with a bug.
In the data
/eod/SPY.US?from=2016-09-02&to=2026-09-03&fmt=json and the same for BTC-USD.CC, joined on date: the row counts differ by more than a thousand, and the join is where the calendar lesson is learned. ?period=w and ?period=m give weekly and monthly bars whose adjusted_close is the period's last, which is the right input for a monthly return series and the wrong one for a daily volatility.
Try it now
- Here are the three sessions around the split from
/eod/AAPL.US. Compute the 31 August 2020 return oncloseand onadjusted_close. One of them is not a return. Measured on 28 September 2026 over the whole of?from=2020-08-01&to=2020-09-30, the largest negative daily move was −74.2% onclose, on 31 August, and −8.0% onadjusted_close, on 3 September: say which of the two dates a news search would find something on.
Measure 28 August to 31 August 2020 — on the adjusted series the chart draws, nothing happens. That absence is the correct answer.