Historical market data for backtesting must match the decision clock用于回测的历史市场数据必须匹配决策时钟
Choose data by the strategy’s information set, not by the largest advertised history. A daily fundamental strategy needs point-in-time statements, filing availability, corporate actions and historical universe membership. An intraday strategy needs exchange calendars, timestamps, quote or trade granularity, missing-bar policy, latency assumptions and realistic spread. A dataset can be accurate today yet invalid for a past decision if it contains later revisions.
应按策略的信息集选数据,而不是按宣传的最长历史选数据。日频基本面策略需要时点正确的报表、申报可用时间、公司行动与历史成分;日内策略需要交易日历、时间戳、报价或成交粒度、缺失K线策略、延迟假设与现实价差。即使数据今天准确,只要包含后续修订,也可能不适合模拟过去决策。
Who could be traded?当时可交易谁?
Active, delisted, renamed, acquired and multi-class securities; historical index or screen membership.
活跃、退市、更名、被收购和多股类证券,以及历史指数或筛选成分。
What was known?当时知道什么?
Availability timestamp, revision, fiscal period, source, units, currency and version.
可用时间、修订、财期、来源、单位、币种与版本。
What could have filled?当时如何成交?
Signal delay, next eligible price, bid-ask spread, fees, slippage, volume and market impact.
信号延迟、下一可成交价格、买卖价差、费用、滑点、成交量与市场冲击。
Build a six-stage point-in-time backtesting pipeline构建六阶段时点正确回测管道
Freeze the historical universe冻结历史投资范围
Store effective membership dates and include securities that later disappeared.
保存成分生效日期,并包含后来消失的证券。
Ingest raw prices and calendars采集原始价格与日历
Preserve vendor fields, timezone, venue, interval, request and retrieval timestamp.
保留供应商字段、时区、场所、周期、请求与获取时间。
Version corporate actions版本化公司行动
Keep splits, dividends, mergers, spin-offs and symbol changes separately from raw bars.
把拆股、分红、并购、分拆与代码变更和原始K线分开保存。
Join features as-of time按可用时间连接特征
Use when a record became observable, not only the fiscal or event date it describes.
使用记录实际可观察时间,而不只是其描述的财期或事件日期。
Simulate executable orders模拟可执行订单
Delay fills appropriately and model spread, fees, slippage, borrow and capacity.
适当延后成交,并建模价差、费用、滑点、借券与容量。
Lock out-of-sample windows锁定样本外窗口
Separate training, tuning and evaluation; preserve parameters, code and data hashes.
分离训练、调参与评估,并保存参数、代码和数据哈希。
Stop four common ways historical data makes a backtest lie阻止历史数据让回测失真的四种常见方式
Current symbols rewrite history当前标的重写历史
A universe built from today’s members silently removes bankruptcies, delistings and removals. Reconstruct membership on each decision date.
用今天的成分构造历史范围,会静默删除破产、退市和被剔除标的。必须按每个决策日重建成分。
Period date is not availability time期间日期不等于可用时间
A year-end statement was not known at year-end. Join by filing or release availability and preserve later revisions separately.
年末报表并不会在年末立即可知。应按申报或发布日期连接,并单独保存后续修订。
Back-adjustment changes price history后复权改变价格历史
Keep raw values and event tables. Apply one documented policy consistently to signals, fills, shares and portfolio accounting.
保留原始值与事件表,对信号、成交、股数和组合记账一致应用一套书面策略。
The bar is not a guaranteed fillK线不是保证成交价
A close-based signal cannot automatically fill at the same close. Add decision delay, spread, liquidity, fees and market-impact assumptions.
基于收盘价生成的信号不能自动按同一收盘价成交。应加入决策延迟、价差、流动性、费用与市场冲击。
Choose daily, intraday, trade or quote data from the execution model根据执行模型选择日频、日内、成交或报价数据
Daily OHLCV can be sufficient when signals are formed after the close and orders execute no earlier than the next eligible session. Intraday bars are useful for time-of-day rules, but they compress the sequence of trades and quotes inside each interval. Trade data observes executions without showing the full opportunity set; quote data adds bid, ask and spread information but creates much larger storage and processing requirements. More granularity is not automatically more truth—the strategy must define which event could trigger a decision and which later event could fill it.
当信号在收盘后形成、订单最早在下一可交易时段执行时,日频OHLCV可能足够。日内K线适合分时规则,但会压缩周期内成交与报价的先后顺序。成交数据能看到实际成交,却不展示完整机会集合;报价数据增加买价、卖价和价差信息,同时显著提高存储与处理要求。粒度更细不等于更真实,策略必须定义哪个事件能够触发决策、哪个后续事件能够成交。
Portfolio and factor tests组合与因子测试
Verify session date, official close definition, split and dividend treatment, non-trading days, stale prices and next-session execution.
核验交易日、官方收盘定义、拆股与分红处理、非交易日、过期价格和下一时段执行。
Time-sensitive strategies时间敏感策略
Verify bar boundaries, timezone, daylight saving, auction periods, extended hours, interval gaps and whether bars are empty or absent.
核验K线边界、时区、夏令时、集合竞价、盘前盘后、周期缺口,以及无成交时K线为空还是缺失。
Microstructure and fills微观结构与成交
Verify venue, condition codes, corrections, cancellations, sequence, quote side, NBBO assumptions and timestamp precision before simulating orders.
模拟订单前核验交易场所、条件代码、更正、取消、序列、报价方向、NBBO假设与时间戳精度。
Schema drift also matters. Vendor fields, enum values, endpoint defaults and adjustment behavior can change after the data is first downloaded. Store a schema version and raw payload alongside normalized columns. Treat a backfill as a new dataset version, compare row counts and value changes, and never overwrite the snapshot that produced a reported result.
结构漂移同样重要。供应商字段、枚举值、端点默认值和复权行为可能在首次下载后变化。应在规范列旁保存结构版本与原始载荷,把回填视为新数据版本,比较行数和数值变化,并且绝不覆盖曾生成报告结果的快照。
Use FMP historical prices as one layer of the research dataset把FMP历史价格作为研究数据集的一层
FMP’s official quickstart documents historical OHLCV endpoints, company profiles, financial statements and related research data. Its public materials also describe long price and fundamental histories. Those capabilities make FMP a candidate for price-plus-fundamental prototypes, but endpoint availability, history, adjustment behavior, delisted coverage, revisions, limits and commercial rights must be verified against the current account.
FMP官方快速入门记录历史OHLCV端点、公司资料、财务报表和相关研究数据,公开材料也描述较长的价格与基本面历史。这使FMP可作为价格加基本面原型候选,但端点可用性、历史范围、复权行为、退市覆盖、修订、限制和商业权利必须对照当前账户核实。
Official sources: FMP API quickstart, FMP historical market data guide, and FMP terms.
官方来源:FMP API快速入门、FMP历史市场数据指南与FMP条款。
Reject a dataset that cannot reproduce the same run无法复现同一运行的数据集应被拒绝
- Coverage:覆盖: expected sessions, symbols, venues and delistings with explicit gap reports. 预期交易日、标的、场所与退市覆盖,并有明确缺口报告。
- Time:时间: UTC normalization, exchange calendar, daylight-saving rules and observable-time joins. UTC规范、交易所日历、夏令时规则与可观察时间连接。
- Economics:经济性: splits, dividends, fees, spread, slippage, borrow and capacity. 拆股、分红、费用、价差、滑点、借券与容量。
- Reproducibility:可复现: immutable snapshot, schema version, code hash, parameters, seed and run log. 不可变快照、结构版本、代码哈希、参数、随机种子与运行日志。
- Rights:权利: permitted storage, derived use, team access, publication and redistribution. 允许的存储、衍生使用、团队访问、发布与再分发。
Use QVeris to govern data access, not to certify a strategy用QVeris治理数据访问,而不是为策略背书
Tool and provenance controls工具与来源控制
QVeris can help AI workflows call authorized market, statement and filing tools with bounded dates, quotas, provider identity and source metadata. Preserve raw evidence before any model summary.
QVeris可让AI工作流在日期、额度、供应商身份与来源元数据约束下调用已授权行情、报表与文件工具。模型总结前应先保存原始证据。
Research responsibility remains研究责任仍然存在
QVeris does not remove look-ahead or survivorship bias, guarantee fills, validate a strategy, grant data rights or promise live performance. Those require research design, testing, contracts and human review.
QVeris不会自动消除前视或幸存者偏差,不保证成交,不验证策略,不授予数据权利,也不承诺实盘表现。这些需要研究设计、测试、合同与人工复核。
Related guides: algorithmic trading API architecture, FMP vs Polygon.io, and financial statement analysis.
相关指南:算法交易 API 架构、FMP 与 Polygon.io 对比以及财务报表分析。
Historical market data for backtesting questions用于回测的历史市场数据常见问题
What historical market data is needed for backtesting?回测需要哪些历史市场数据?
Match universe, granularity, timestamps, corporate actions, delistings, features and execution assumptions to the strategy’s decision clock.
让投资范围、粒度、时间戳、公司行动、退市、特征与执行假设匹配策略决策时钟。
Should backtests use adjusted or unadjusted prices?回测应使用复权还是未复权价格?
Preserve both raw prices and events, then apply a documented policy consistently across signals, fills, shares and accounting.
保留原始价格与事件,再对信号、成交、股数和记账一致应用书面策略。
How do I avoid survivorship bias?如何避免幸存者偏差?
Use historical membership and include delisted, acquired and renamed securities that were investable at each simulated date.
使用历史成分,并包含每个模拟日期可投资的退市、被收购和更名证券。
How do I avoid look-ahead bias?如何避免前视偏差?
Join every feature by availability time and delay the simulated action until after the information could be observed.
按可用时间连接每个特征,并把模拟行动延后到信息可观察之后。
Is free historical data enough for backtesting?免费历史数据足够回测吗?
It can support prototypes, but quality depends on delistings, adjustments, gaps, timestamps, history, rights and reproducibility—not price alone.
可用于原型,但质量取决于退市、复权、缺口、时间戳、历史、权利与可复现性,而不只是价格。
Can QVeris help with backtesting data?QVeris能帮助处理回测数据吗?
QVeris can govern authorized tools and provenance, while the research system still owns time alignment, bias control, execution and licensing.
QVeris可治理已授权工具与来源,研究系统仍负责时间对齐、偏差控制、执行与许可。

