Why we store split-adjusted prices and apply dividends at read time
Every market database has to answer the same question: when a company splits its stock or pays a dividend, what happens to the prices you already stored? There are two common answers, and both cause trouble.
- Store raw prices and adjust later, everywhere. Every query, indicator and report has to remember to adjust. One that forgets shows a 90% crash on the day of a 10-for-1 split.
- Rewrite history whenever an action happens. Simple to query, but the past keeps changing underneath you, and a bad factor silently corrupts years of data.
EquationDB does neither.
Splits: adjusted when read
When a split happens, earlier bars are adjusted on read by a factor. The bars on disk are never rewritten. Indicator state and events that the split affects are rebuilt, and any event that no longer holds is retracted as an amendment in the feed, so alerts and downstream systems hear about it.
You can see it around NVIDIA's 10-for-1 split in June 2024:
GET NVDA SELECT close FROM 2024-06-03 TO 2024-06-14
There is no cliff in the series: bars before the split are divided by 10 as they are read.
Dividends: a factor you choose to apply
Dividends are different. A split changes the unit of the price; a dividend is real money paid out. Both views are useful, so EquationDB keeps each dividend as a per-bar factor and lets you pick the basis with ADJ:
ADJ | Prices |
|---|---|
split (the default) | split-adjusted: the prices that traded, in today's share units |
total | split- and dividend-adjusted: total return, dividends reinvested |
GET KO SELECT close LAST 5y
GET KO SELECT close LAST 5y ADJ total
The first is Coca-Cola's price return; the second is what a holder actually earned. The most recent closes match; further back, the total-return closes are lower, because each dividend lifted what came after it.
Why the default is split-adjusted
Indicators, levels and screens use split-adjusted prices because they describe the market as traders saw it. A 52-week high, a support level or an RSI reading should be computed from prices that actually traded, not from a series that changes every time a dividend is paid.
Returns are a different matter. ANALYZE reports compute returns from total-return closes and price levels from split-adjusted bars, and seasonality uses total return so dividend payers are not penalized in their ex-dividend months.
What this buys you
- Stable history. What you queried last month returns the same bars today, unless a correction was recorded, and corrections are visible.
- No false events. A split never shows up as a crash, a gap or a new low.
- Your choice of basis. Price return or total return, from the same stored data, with one keyword.
More detail is in Data, adjustments & freshness.