Backtesting guide
Backtesting Data: What You Need and Where to Find It
Backtesting data is the historical information available to a simulated strategy. The required dataset depends on when decisions occur, how orders are modeled, and which instruments could actually have been selected at each date.
Read the practical guideKey Takeaways
- Match signal data and execution data to the decisions being simulated.
- Document provider, timestamps, universe, adjustment rules, and license.
- Reconcile corporate actions and futures rolls before interpreting returns.
- Save cleaning rules and reserve validation data before parameter selection.
Choose data for both signals and fills
A daily close-based signal may need only daily prices for its calculation, but that does not settle how an intraday stop or limit order would fill. OHLC bars show extrema without the full order of events. Trade ticks add transaction detail; quote ticks describe bids and offers. Neither automatically includes order-book depth or your queue position. Select the resolution and fields needed by the execution assumptions, not simply the largest available file.
- Record whether volume means traded units, contracts, or a provider-specific tick count.
- For options, identify the contracts, expiry, strike, and bid/ask observations needed by each leg.
- For fundamental or news signals, preserve publication and availability times as well as the reporting period.
Choose a source and check its permitted use
For Pine Script, TradingView supplies the chart dataset and supported request functions for other symbols, timeframes, and data types. request.security() is not unrestricted access to every symbol or arbitrary external files. Availability, history, and account entitlements still apply. QuantConnect offers datasets within its research and backtesting platform. Its licensing documentation says most price data is free for cloud use, but cloud access and local download licenses are separate. Review the specific dataset, resolution, coverage, and license before promising an export or API workflow. Free access is not permission to redistribute data, and a paid source is not automatically more accurate.
- Save provider, exchange or venue, symbol mapping, resolution, session, and retrieval date.
- Check how the provider handles corrections, missing observations, and delistings.
- Confirm whether you may use, retain, and export the data for the intended workflow.
Keep price adjustments and cash flows consistent
Raw, split-adjusted, dividend-adjusted, and total-return series serve different purposes. Read the provider definition: “adjusted” is not a universal formula. If a simulation uses raw prices, it still needs correct share and cash adjustments for corporate actions. If dividends are already reflected in the return series, adding them again can double count income. A hypothetical two-for-one split halves the quoted price and doubles the share count before other market moves. It is not a 50% economic loss. Reconcile a known action against the issuer or exchange record and check that price, position quantity, and cash treatment agree. Historical adjustment alone does not prove look-ahead bias; the concern is whether a decision used information or a price representation unavailable at that time. Continuous futures require another check. A back-adjusted series can remove roll gaps for analysis, but it is not one contract that could have been held indefinitely. Document contract selection, roll timing, and roll costs separately.
Audit the universe and event times
Using only today's surviving symbols or current index members can change the historical investment opportunity set. Include the relevant delisted securities and point-in-time membership when testing a universe-selection rule. Testing one ETF price series is a different task from reconstructing a portfolio of its changing constituents. Store timezone and daylight-saving conventions, whether a bar timestamp marks its start or end, and when a value becomes usable. A quarterly accounting date is not its publication date. Use the version of a revised economic or fundamental observation available at the decision time. Do not silently forward-fill a missing price as though it were an executable quote.
Run a small data audit before a large parameter search
Check duplicate and out-of-order timestamps, unexplained gaps, impossible OHLC relationships, and abrupt changes around corporate actions or futures rolls. Compare a small selection of suspicious records with an independent primary record where available; disagreement is a reason to investigate, not to choose whichever feed gives the better strategy result. Save the original dataset and any cleaning rules. Choose the history window for the hypothesis and market conditions being studied. No fixed number of years, trades, or bars establishes validity. Reserve a later period before tuning, and account for indicator warmup and positions crossing the split. A 20% holdout is one possible design, not a guarantee or universal requirement.
Where Pineify fits
Pineify can help implement explicit rules as Pine Script and automate selected TradingView inputs. It does not supply the underlying historical chart dataset. Backtest Report analyzes compatible exported trade records; it cannot repair missing market history or establish that the original simulation had realistic fills.
Primary sources
- TradingView: Other timeframes and dataVerified 2026-10-20
- QuantConnect: Dataset licensingVerified 2026-10-20
- QuantConnect: Corporate actionsVerified 2026-10-20
- TradingView: Continuous futures back adjustmentVerified 2026-10-20
This page is educational. Historical simulations depend on data and assumptions and do not guarantee future results. Trading can result in substantial loss.