Research by conversation
Ask the agent to investigate markets, companies, filings, strategies, and your connected account context.
Backtest data-integrity guide
Reconstruct what your strategy could have known at each decision time. Point-in-time datasets, historical universes, release timestamps, consistent corporate-action handling, and correctly aligned indicators prevent impossible signals from appearing valid.
Ask the agent to investigate markets, companies, filings, strategies, and your connected account context.
When direct trading is enabled, request a one-time trade in plain English, inspect the order, and approve it before submission.
Create, revise, backtest, connect, and operate Lumibot strategies without assembling the full application stack yourself.
Work in BotSpot or connect through ChatGPT, Claude, Cursor, Codex, and other compatible MCP clients.
Look-ahead bias occurs when a historical decision uses information that was unavailable at that decision time. Data leakage is broader: evaluation data influences strategy construction, feature preparation, parameter selection, or model training.
Every input needs at least two clocks: when the underlying event occurred and when the value became available to the strategy. A reporting period end, market-data timestamp, database timestamp, and public release time may describe different moments.
A current database snapshot can contain corrected prices, revised fundamentals, renamed symbols, and today's index members. Querying that snapshot by historical date does not automatically recreate the information available then.
Use point-in-time records keyed by availability time. Preserve dataset version, source, timezone, revision identifier, and ingestion rule so another test can reconstruct the same information set.
Testing old periods against securities that exist today excludes many delisted companies and can use index membership learned after the fact. This survivorship bias changes both candidate selection and measured results.
Rebuild the eligible universe at each historical date. Include delistings, historical constituents, ticker changes, listing dates, and securities that later failed whenever the strategy could have selected them.
Financial values belong to a reporting period but are not knowable on that period's end date. A quarterly result should enter the simulation only after its filing or release became publicly available.
Amended filings, restatements, and vendor revisions need separate availability timestamps. Do not replace an original value with its latest revision throughout earlier history.
Bar timestamps require explicit interpretation. Alpaca, for example, timestamps a minute bar at the left edge of its interval, while the complete high, low, close, and volume are known only after that interval finishes.
Compute indicators from completed observations. Unless an intrabar model supplies information available before the close, a signal using a bar's closing value cannot also receive that same closing price as an instantaneous fill.
Splits, dividends, spin-offs, symbol changes, and delistings affect prices, holdings, indicators, and cash. Raw and adjusted datasets answer different questions; mixing them can create false signals or double-count returns.
Choose and document one normalization policy for each calculation. If total-return-adjusted prices already incorporate dividends, adding the same dividends as separate cash flows can count them twice.
Machine-learning leakage can occur before model fitting. Scaling, imputation, feature selection, dimensionality reduction, and threshold selection must not learn from evaluation periods.
Split chronologically before fitting transforms. During walk-forward evaluation, fit every learned preprocessing step again using only the current training window, then transform the later evaluation window without refitting.
Passing these checks does not prove a strategy has an edge. Historical datasets can still contain errors, missing observations, vendor-specific corrections, or timestamps that do not represent real delivery latency.
Treat unexpectedly strong results as a reason to inspect data lineage, trades, and timing before interpreting performance.
Using a daily closing price to generate a signal and filling the resulting order at that same close, without an intrabar auction or execution model, uses information before it was fully available.
No. Adjusted data can support return and indicator calculations, but normalization must match the strategy question. Problems arise when adjusted values reveal later corporate actions, conflict with live handling, or duplicate separately modeled dividends and splits.
Survivorship bias excludes assets that disappeared before today. It becomes look-ahead bias when today's survivors or index members define choices available to a strategy in the past.
No. A time frontier limits future access from correctly timestamped data, but custom datasets, revised values, current universes, preprocessing, and incorrect timestamps can still leak future information.
Sources verified 2026-08-14.
Past performance does not guarantee future results. Automated trading involves risk of loss.