TickRun contract: one local CSV per ticker containing Date, Open, High, Low, Close, and Volume, with prices stored on one internally consistent adjusted basis and no live market download at runtime.
Why raw prices can create fake signals
A stock split changes the number of shares and price per share without creating the same economic loss suggested by the raw price jump. In a 2-for-1 split, a raw close near 100 may be followed by a raw close near 50. A naïve engine sees a −50% return, a volatility shock, moving-average break, channel breach, and perhaps several sell signals. Economically, an investor now owns twice as many shares at roughly half the price.
Adjustment restates history onto a comparable share basis. Prices before the event are scaled so the split is not mistaken for market movement. Depending on the provider and series, dividend adjustments may also restate earlier prices so close-to-close percentage changes approximate total return. “Adjusted” is not a universal schema: the provider’s methodology must be known.
Adjust all price fields consistently
Changing only Close while leaving Open, High, and Low raw creates impossible bars. Before a split, adjusted Close might be 50 while raw High remains 102. True range, Average True Range, stochastic oscillators, channels, candlestick logic, and any comparison across fields become corrupted.
TickRun’s saved snapshots contain adjusted Open, High, Low, and Close. When replacing them, apply the same price adjustment factor to all four price fields. Preserve the bar identities:
Low ≤ Open ≤ HighLow ≤ Close ≤ High- all prices finite and strictly positive
If a vendor supplies only Adjusted Close beside raw OHLC, do not relabel that file as fully adjusted OHLCV. Either derive a documented factor and adjust every price field consistently or use a source that supplies the required semantics.
Volume uses the inverse split logic
For a simple split, price is divided by the split factor while the comparable historical share volume is multiplied. A pre-split trade of 1,000 old shares corresponds to 2,000 new shares after a 2-for-1 split. Applying the price factor to volume in the same direction is a common error.
Dividend adjustment is different: cash dividends affect total-return price continuity but do not mechanically multiply the historical number of shares traded. Provider methodologies vary for spin-offs, rights, special distributions, and volume. CRSP’s documented approach, for example, distinguishes price/dividend adjustments from share/volume adjustments. Never infer volume treatment from a column name alone.
This matters to TickRun’s volume-driven strategies—ADI, CMF, EOM, Force Index, MFI, NVI, OBV, VPT, and VWAP—not merely to display. A discontinuous or mis-scaled volume series can move cumulative indicators permanently.
Price return versus total return
A price-only close drops by approximately the dividend on the ex-dividend date, even though the shareholder receives cash. A dividend-adjusted close typically rewrites earlier observations so the return series includes reinvested distributions. For long histories or high-yield stocks, the distinction can materially change Buy & Hold and every indicator based on past prices.
Consistency beats selective realism. If signals use dividend-adjusted prices but execution and benchmark use raw closes, the test combines incompatible economic series. If the benchmark includes dividends but the strategy does not, relative performance is biased. State whether results represent price appreciation or total return and use that convention throughout.
How TickRun reads a file
The server discovers approved ticker files in data/market_data/. It validates the requested symbol against that inventory rather than accepting an arbitrary path. Rows are parsed as dates and numeric OHLCV values, sorted chronologically, and duplicate dates are removed by keeping the last occurrence. The requested start/end interval is filtered on the server and returned only when the browser asks for it.
The application does not call Yahoo Finance or another market-data service. The current AAPL, KO, and NKE files are frozen local snapshots limited to the latest ten calendar years at the time they were prepared. Updating is an explicit maintenance operation, which improves reproducibility: tomorrow’s provider revision cannot silently change today’s saved test.
Dates, sessions, and missing rows
Daily equity is indexed by trading observations, not calendar days. Weekends and exchange holidays should not be synthesized as zero-return bars. Conversely, a missing genuine trading session shortens indicator windows and turns a two-session price move into one observed return.
Use an unambiguous ISO date, YYYY-MM-DD, representing the exchange session. Avoid timestamps unless timezone and session-close rules are explicit. Reject duplicate dates during preparation rather than relying on “keep last” to choose between conflicting records. Investigate unexplained gaps against an exchange calendar.
Zero volume may be legitimate for some instruments or suspensions, but it is unusual for a liquid U.S. large-cap session. Missing volume must not be converted silently to zero because “unknown” and “no shares traded” are different facts.
Adjusted does not mean point-in-time
Adjustment fixes certain corporate-action discontinuities; it does not remove survivor bias, ticker changes, delistings, restatements, or present-day selection. Choosing Apple today and looking backward answers how a specified rule behaves on the company we now know survived. It does not recreate a 2016 investor’s opportunity set.
Universe research requires a point-in-time security master, historical constituents, delisted securities, symbol mappings, merger proceeds, and defensible delisting returns. TickRun is currently a single-selected-ticker research tool, not that database. The limitation should constrain the claim, not be hidden in a footnote.
Historical files can change
Providers correct bad prints, add corporate actions, alter adjustment methods, and revise metadata. Therefore “AAPL, 2016–2026” is not a complete provenance record. Preserve source, retrieval date, adjustment definition, timezone, currency, and a file hash. If a snapshot is replaced, saved results from the older file may no longer reproduce unless the version is retained.
A production system can attach a dataset identifier or checksum to every saved backtest. TickRun currently saves the selected ticker, date range, configuration, metrics, and equity/trade output, but it does not expose a dataset checksum in the result. Until that is added, archive the exact CSV with research records that must remain auditable.
Pre-import validation checklist
- Exactly one header row with Date, Open, High, Low, Close, Volume.
- Dates are unique, increasing after sorting, and use ISO format.
- Every OHLC field shares the same adjustment basis.
- High/low bounds contain open and close.
- Prices are positive; volume is nonnegative and semantically defined.
- Large returns are reconciled with news and corporate actions.
- Split days do not create artificial price or volume jumps.
- Currency and exchange are documented.
- The file contains no more than the intended latest ten years.
- The company-name mapping matches the ticker list.