Every backtest is only as honest as its price history. Split adjustments, missing bars, and misaligned timestamps silently inflate Sharpe ratios. A strategy that looks brilliant on bad data fails live in ways that are expensive and embarrassing. Before you trust a strategy live, you need OHLCV data that matches what the market actually traded.
Corporate actions are the usual culprit. A reverse split that is not adjusted makes a penny stock look like it trended smoothly upward for years. Dividends treated inconsistently distort total-return comparisons across names in the same universe. Session boundaries matter too. Bars that mix extended hours with regular session without labeling confuse signals built on close-to-close returns.
Vantafin does not expose a public REST endpoint for historical OHLCV bars. Use get_price_history via the MCP server to fetch split-adjusted historical bars with consistent session boundaries for U.S. equities. This tutorial walks through building a simple moving-average crossover backtest on a screener-exported universe.
Fetch aligned bar series
Call get_price_history with your symbol, date range, and interval. Choose daily or intraday depending on your strategy. Responses include open, high, low, close, and volume. Batch by universe: export tickers from a screen into a CSV, then loop with polite concurrency that respects documented rate limits. Log failures per symbol so one delisted name does not abort the entire pull.
Corporate actions are applied in our price history pipeline; confirm methodology in docs before you compare Vantafin results to a legacy vendor. Handle missing sessions explicitly in your loader (trading halts and holidays should be gaps, not forward-filled closes that invent liquidity.
Validate a single name on Amazon against its company chart before scaling. Spot-check splits and earnings gaps manually once; automate forever after.
Run the backtest skeleton
Compute signals on adjusted closes, apply transaction cost assumptions you document, and never peek at future rows. Walk-forward splits reduce overfitting: train parameters on one window, test on the next, roll forward. Store results alongside macro features from the treasury yield curve if your strategy is rate-sensitive. Even equity factors often correlate with curve shape in ways a pure price backtest misstates.
For recent-session validation, compare bar volume against live OHLCV on LM or LS channels to sanity-check liquidity. A signal that backtests on million-share daily volume but live trades in thin prints needs a reality discount.
Report drawdowns and turnover, not just CAGR. A moving-average crossover that trades rarely tells a different deployment story than one that churns daily. Honest reporting starts in the skeleton, not after a lucky parameter sweep.
Operational hygiene
Cache bars locally after the initial pull; respect rate limits on pricing. Use watchlists to version universes ("Q1 2026 momentum basket" beats "final_v3_really_final.csv." The MCP server is the right surface for agent-assisted research when you need ten names, not ten thousand.
Version your data pulls by pull date. When methodology improves, rerun backtests from scratch rather than patching mid-series. Reproducibility is a feature, not paperwork.
Price history conventions and corporate actions
Every backtest is only as honest as its price history. Split adjustments, missing sessions, and misaligned timestamps silently inflate Sharpe ratios. Before you trust a strategy live, document your adjustment assumptions and verify them against known corporate-action dates on the calendar.
Vantafin serves split-adjusted history through get_price_history in the MCP server, which returns OHLCV rows plus a performance summary for the requested window. Match bar interval to strategy holding period so noise does not dominate. Daily history suits factor tests; shorter windows suit event studies around earnings. Corporate actions are applied in the pipeline; spot-check a single name on Amazon against its company chart before scaling to a full universe.
When you need tick fidelity intraday, per-second LS and per-minute LM streams on wss://socket.vantafin.com/v1/stocks capture live session shape you can archive for recent-session validation. Historical research and live monitoring answer different questions; many teams backtest on get_price_history and sanity-check liquidity on LM during the current week.
Universe bias and validation discipline
Backtests on today's screener universe introduce survivorship bias. Point-in-time constituent lists beat current-only screens for honest research, even when they are harder to maintain. Reserve the most recent twenty percent of data for validation never touched during parameter tuning, and log every filter change so results stay reproducible six months later.
Export tickers from a screen into a CSV, then loop get_price_history with polite concurrency that respects documented rate limits on pricing. Pre-aggregate features in your warehouse instead of re-fetching raw rows each run) network cost dominates many research loops long before alpha decay does.
Pair bar research with bulk quote snapshots when you need entry confirmation fields at defined clock times. Promote stable signals to email price alerts once backtest logic freezes; live execution and backtest edge are different problems.
Exploration with agents and event studies
Ask the MCP server to pull five years of daily history for a ticker and compute rolling volatility for fast sanity checks before full pipeline work. Combine history with pre-earnings news drift windows to study whether pre-print momentum predicted post-print continuation or reversal.
Store corporate-action audit trails alongside bar files so you can explain a sudden return spike as split-related rather than alpha-related. Good backtest hygiene is boring until a client asks why your 2019 results changed) then it is the most valuable work on the project.