What Historical Data Does a Stock Backtest Actually Need?
The minimum viable dataset depends on the strategy — a monthly rebalancing rule needs less than an intraday one. What every stock backtest needs regardless of style is point-in-time accuracy: data that reflects what genuinely existed and was knowable at each historical date, not what is true today, restated with the benefit of hindsight.
Price and Volume Data
Daily open, high, low, close, and volume — OHLCV — is enough for a strategy that decides once per session and whose exits do not depend on the path a price took within the day. Intraday requirements grow from there: bid and ask quotes, quote sizes, individual trade prints, session markers separating pre-market, regular-session, and after-hours activity, opening and closing auction prints, and records of trading halts.
Intraday data becomes necessary in a few recurring situations: when an exit depends on which of two intrabar levels was touched first, when entries are triggered by an opening-range move rather than a full session's close, when the position size is large enough that execution timing within the day changes the realistic fill price, or when a strategy holds for minutes or hours rather than sessions. Absent one of those conditions, daily bars are usually sufficient, and adding intraday data without a specific reason mainly adds storage and processing cost without changing the conclusion.
Volume figures also differ depending on whether they represent trades on a single primary exchange or consolidated volume across every reporting venue. A liquidity filter calibrated against consolidated volume will behave differently if the underlying data source quietly switches to primary-exchange-only volume, even though nothing in the strategy's own rules changed.
Why daily OHLCV is sometimes not enough
Hypothetical example — for education only.
A session prints open $50, high $55, low $48, close $53. The bar alone does not reveal whether the $55 high or the $48 low came first. Suppose a strategy is holding a long position from the prior day with both a stop at $49 and a target at $54 working at the same time. Both levels sit inside this session's range, so both were touched — but the outcome depends entirely on which one was touched first. If the price reached $55 before $48, the target filled near $54 and the trade closed at a gain. If it reached $48 first, the stop filled near $49 and the trade closed at a loss. Daily data cannot distinguish these two entirely different historical outcomes, and whatever assumption the backtest makes to resolve it becomes part of the result — not a fact recovered from the data, but a choice the developer made on the data's behalf. Assuming the favorable sequence flatters performance; assuming the unfavorable sequence is more conservative, but it can still misstate the true outcome if the real fill would have landed somewhere between the two extremes.
Survivorship Bias and the Current-Constituent Trap
Survivorship bias is evaluating the past using a sample shaped by survival into the present.
Suppose you test a strategy over 2005 to 2025 using today's members of a major index. That list systematically excludes:
- Companies that failed outright during the period.
- Companies whose share price declined so far they no longer met listing or index requirements.
- Companies that merged into another business and stopped trading independently.
- Companies that were acquired and delisted.
- Companies that fell below the index's liquidity, size, or profitability requirements.
- Companies added to the index only recently, whose earlier history reflects a period when the strategy could not actually have selected them.
The companies still standing today often have stronger historical records than the full population that actually existed at the time — not because a strategy identified them in advance, but because the sample was drawn from survivors. That difference can inflate a backtest's apparent returns without any error appearing anywhere in the code.
The bias runs in only one direction for a long-only strategy, which is part of why it is so persistently underestimated. A universe built from survivors cannot accidentally include a company that failed early and never recovered, because that company is definitionally not a survivor. Every exclusion removes a potential loss from the sample and never a potential gain, and the effect compounds the longer the test period runs.
Use historical eligibility, not permanent eligibility
Eligibility belongs to a date, not to a company. A stock may have passed a liquidity threshold in 2022 and failed the same threshold in 2012 — both facts can be true at once. Removing the 2012 period on the reasoning that the company later grew large enough to qualify imports present knowledge into a past decision, which is the current-constituent trap in miniature. Apply each filter using the values that existed on the evaluation date, and let the universe expand and contract the way it actually did.
The same logic runs in reverse for a newly listed company. A rule requiring at least 252 trading days of history will correctly exclude a company for its first year on an exchange — treating it as eligible earlier than that, simply because the requirement is trivially satisfied by the time the backtest is run, reproduces the same error with the sign flipped.
Delistings carry a residual value, not just an end date
A delisting is not simply the last row in a price series. It carries a residual value that may be zero, in the case of a bankruptcy that wipes out equity holders, or that may reflect real consideration received, in the case of a merger, an acquisition, or a going-private transaction at a premium to the last traded price. Recording every delisting as an uninformative stop, rather than as an event with its own associated outcome, can bias a result in either direction depending on which kind of delisting actually occurred and whether the strategy held a position through it.
Corporate Actions
Prices are not continuous through corporate events. A complete backtest needs a record of:
- Forward stock splits.
- Reverse stock splits.
- Cash dividends, including special dividends.
- Stock dividends.
- Ticker symbol changes.
- Mergers and acquisitions.
- Spin-offs.
- Rights offerings.
- Delistings.
Raw prices alone do not preserve economic continuity across any of these events. A missing split shows up as an enormous single-day price move that never actually happened. A missing dividend understates long-run returns. A missed delisting can leave a simulated position open indefinitely at a price that stopped being real the day trading ceased.
Some of these are simple arithmetic adjustments; others require a judgment about how much value survived the event and where it landed. A merger paid entirely in acquirer stock leaves former shareholders holding a different security altogether, and a backtest has to decide whether that exchange counts as an exit from the original position, an entry into the new one, or both — a decision the strategy's rules need to make explicitly rather than leaving to whatever the code happens to do when it encounters a ticker that stopped trading for a reason other than delisting.
Raw Prices vs. Adjusted Prices
Raw prices are the prices that actually traded on a given day. Adjusted prices are historical prices restated so that returns are continuous through splits and, in a total-return series, dividends — every price before the event is scaled so the event does not appear as a discontinuity.
| What you're doing | Series to use |
|---|---|
| Computing returns, moving averages, volatility, rankings | Adjusted |
| Reconstructing actual order prices and share counts | Raw |
| Applying a raw price-based eligibility rule | Raw |
| Simulating dividend cash receipt and split-driven share-count changes | Raw, plus discrete corporate-action events |
A robust setup can keep both: an adjusted series for research calculations, and a raw series plus discrete corporate-action events for simulated trading, so dividends post as cash on their payment dates and splits change the share count on their effective dates rather than smoothing invisibly into the price history.
Adjusted series themselves come in more than one form. A price-return adjusted series accounts for splits only; a total-return adjusted series also reinvests dividends into the price path. Using a price-return series where a total-return series was intended understates the very returns the adjustment was supposed to make comparable across time — a subtle mismatch that will not throw an error, only a quietly lower number.
A rule requiring a minimum raw share price of $5 should not be applied blindly to a retrospectively adjusted series without understanding how the adjustment changes historical values. A stock trading at $8 in 2010 that has since split three-for-one may appear in adjusted data at under $3 for that same date, excluding a stock that plainly qualified at the time. The reverse error happens with reverse splits, admitting stocks that were trading for pennies on the date the filter was supposed to keep them out.
Fundamental and Alternative Data Must Be Point-in-Time
A strategy might use earnings per share, revenue, free cash flow, valuation ratios, balance-sheet data, analyst estimates, earnings dates, filing dates, insider transactions, or institutional ownership. Every one of these fields carries the same requirement.
Point-in-time data preserves three things: the value known on the date, the date and time it became available, and later revisions as separate observations rather than replacements.
Using the latest restated financial value throughout history introduces future knowledge into the test. A ranking built on a company's currently reported earnings figure, applied to a date years before that figure existed, is not describing a decision anyone could have made at the time — it is describing a decision made with information from the future.
Analyst estimates carry an additional wrinkle: the consensus figure itself changes daily as individual estimates are added, revised, or withdrawn, so a database needs to store not just a single number but the specific vintage of the consensus being referenced on a given date. Insider transaction and institutional ownership data are typically reported with a filing lag of their own, meaning genuine public availability can trail the underlying transaction date by days or weeks, and a strategy that reacts on the transaction date rather than the filing date is reacting before the information existed publicly.
Data-Quality Checks Before You Trust a Single Result
Every one of the defects below can look like an ordinary data point to code that is not specifically checking for it, and each has produced a backtest that reported strong results built on an artifact rather than a market behavior. Inspect the data before the first simulation:
- Missing sessions.
- Duplicate rows.
- Zero or negative prices.
- Unexplained price jumps.
- Incorrect split adjustments.
- Stale quotes.
- Impossible high-low relationships.
- Volume unit changes.
- Time-zone inconsistencies.
- Premarket data mixed with regular-session data.
- Symbols incorrectly joined across companies.
Run the full set of checks again any time the data vendor, retrieval method, or historical range changes — a clean pull last quarter is no guarantee the next one arrived intact. A clean-looking equity curve does not prove the underlying data is clean; it is just as likely to be a symptom of a problem that happens to point in a favorable direction.
Security Types and Universe Definition
A database labeled "stocks" often contains considerably more than common shares: common shares, American depositary receipts, preferred shares, exchange-traded funds, closed-end funds, special-purpose acquisition vehicles, warrants, rights, units, limited partnerships, and real estate investment trusts.
The test specification must state which of these are permitted, since different types carry different liquidity, corporate-action, distribution, and structural characteristics. Leaving the door open to instrument types the strategy was never meant to trade can quietly shift where a backtest's returns actually come from.
Real estate investment trusts distribute income differently from ordinary corporations and operate under separate rules that affect price behavior around distribution dates. Closed-end funds can trade at a persistent premium or discount to the value of their underlying holdings, a dynamic that open-ended index products do not share. Special-purpose acquisition vehicles behave like a cash shell before a business combination and like an operating company afterward, with a valuation profile that shifts abruptly at the combination date rather than drifting gradually the way an established company's typically does.
Common Mistakes
- Testing only current index members. The result describes a group of survivors, not the historical universe the strategy would actually have traded.
- Using adjusted prices for a raw price-eligibility rule. A minimum-price filter applied to a retrospectively adjusted series silently admits or excludes the wrong stocks.
- Treating a delisting as a return of zero without checking whether that overstates or understates the actual loss. Some delistings return partial value through a merger or liquidation; a flat zero is not automatically the conservative assumption.
- Ignoring symbol changes and accidentally splicing two different companies' histories together. A reused ticker can silently merge one company's later history onto another's earlier one.
- Using the latest-known fundamental value throughout history. This substitutes a restated or corrected figure for the one that actually existed on each historical date.
- Skipping data-quality checks because the equity curve looks reasonable. A plausible-looking result is not evidence that the underlying prices, volumes, and corporate actions are correct.
- Assuming one data source's adjustment methodology is universally correct. Different sources compute adjustment factors slightly differently around ambiguous corporate actions, and switching sources mid-project can introduce discontinuities that look like data errors but are really methodology differences.
Limitations
No historical dataset is perfectly complete or error-free, and vendors differ in adjustment methodology, delisting treatment, and the timestamp precision of fundamental data. A developer should assume some residual data risk remains even after careful checks, and should treat a backtest's results as conditional on the specific dataset used to produce them. Two developers testing the identical rule set against two reputable but differently sourced datasets can reasonably arrive at somewhat different conclusions, and that gap says as much about the data as it does about the strategy.
Historical Data FAQs
What is survivorship bias in backtesting?
Survivorship bias is evaluating the past using a sample shaped by survival into the present. A stock backtest run on today's index members, for example, implicitly excludes every company that failed, was acquired, was delisted, or fell out of the index before today — a sample that tends to look stronger than the full population that actually existed at the time.
What is the difference between raw and adjusted stock prices?
Raw prices are the prices that actually traded on a given day. Adjusted prices are historical prices restated so that returns are continuous through splits and, in a total-return series, dividends. Adjusted data is generally correct for computing returns and indicators; raw data is generally correct for reconstructing actual order prices, share counts, and price-based eligibility rules.
Why does daily OHLCV data have limitations?
A daily bar records the open, high, low, and close, but not the order in which the high and low occurred within the session. A strategy with both a stop and a target working in the same session can produce different outcomes depending on that unknown sequence, and daily data alone cannot resolve which sequence actually happened.
What does point-in-time data mean?
Point-in-time data preserves the value that was known on a given date, the date and time that value first became available, and every later revision as a separate observation rather than a replacement. Without it, a backtest can end up using a corrected or restated figure that nobody actually had access to at the time being tested.
Should delisted stocks be included in a backtest?
Yes, wherever the strategy's universe rules would have made them eligible at the time. Excluding delisted stocks recreates the current-constituent trap on a smaller scale — the sample keeps only the companies that survived, which tends to inflate the apparent results of a long-only strategy.
Related Guides
- Writing objective trading strategy rules — turning a hypothesis into entry, exit, timing, sizing, and conflict logic.
- In-sample vs. out-of-sample testing — split design, walk-forward windows, and holding back a final test set.
- Avoiding backtest overfitting — trial counting, parameter stability, and research logs.
- Backtesting overview — the full process from hypothesis to forward test.