Historical Options Data Guide历史期权数据指南

Free Options Data
for Backtesting
用于回测的
免费期权数据

Compare free samples, APIs, and hosted platforms, then verify expired contracts, quote history, Greeks, timestamps, and licensing before trusting a backtest.

比较免费样本、API 与托管平台,并在采信回测结果前核对已到期合约、历史报价、希腊值、时间戳与授权条款。

Whiteboard workflow for choosing free options data, retaining expired contracts, validating quotes and Greeks, and modeling fills

TL;DR核心摘要

Best free route

Use samples to test a schema, a hosted platform to test a strategy, and an API free tier only for narrow contract studies.

What “free” means

Expect limited symbols, dates, resolutions, exports, or calls. Complete historical US option chains are rarely free to download.

The hidden risk

Last-price fills, missing expired contracts, stale quotes, and vendor-computed Greeks can make an attractive result impossible to trade.

Backtesting rule

Rebuild the point-in-time chain first, then select contracts and model fills with a documented spread and slippage rule.

最佳免费路径

用样本验证数据结构,用托管平台检验策略;只有研究范围限定在少数合约时,才使用 API 免费套餐。

“免费”的含义

通常会限制标的范围、日期范围、时间粒度、导出量或调用次数。完整的美国历史期权链数据很少能免费下载。

隐藏风险

按最后成交价模拟成交、缺少已到期合约、报价过时,以及使用供应商计算的希腊值,都可能让看似理想的回测结果无法用于实际交易。

回测原则

先重建各历史时点实际可见的期权链,再选择合约,并按照明确记录的买卖价差和滑点规则模拟成交。

Choose free options data that fits the test选择适合回测需求的免费期权数据

Define the market, underlyings, date range, interval, quote or trade requirement, and whether the strategy selects by delta, moneyness, or days to expiration. That specification determines whether a free route is usable.

先明确目标市场、标的资产、日期范围和数据时间粒度,以及需要报价数据还是成交记录;同时还要确定策略是依据 Delta、价内外程度还是距到期日天数来筛选合约。上述条件将决定免费数据渠道能否满足需求。

Free samples and public files

Best for testing parsers and a short proof of concept. Confirm the sample contains bid, ask, expiration, strike, call/put, volume, open interest, and stable contract identifiers.

Hosted backtesting platforms

Often the most practical route because licensed data stays inside the platform. QuantConnect advertises options data and backtesting on its free plan, though compute and export limits still matter.

API free tiers

Useful for a narrow historical probe when the endpoint explicitly supports past dates. Verify expired-contract coverage, pagination, correction policy, quote fields, and whether the free key can request the dates you need.

Commercial vendor samples

Useful for evaluating columns, file size, symbology, and ingestion speed. A clean sample does not prove full-universe completeness, long history, corporate-action continuity, or export rights.

免费样本与公开数据文件

最适合用于测试解析器和开展小规模概念验证。请确认样本包含买价、卖价、到期日、行权价、期权类型(看涨或看跌)、成交量、持仓量,以及稳定且一致的合约标识符。

托管式回测平台

这通常是最实用的渠道,因为授权数据可留在平台内部使用。QuantConnect 宣称其免费套餐包含期权数据和回测功能,但仍需留意算力和数据导出方面的限制。

API 免费套餐

当接口明确支持历史日期时,可用于范围较窄的历史验证。应核对已到期合约覆盖、分页、更正政策、报价字段,以及免费 key 是否能查询所需日期。

商业供应商样本

适合评估字段、文件体量、代码规则和导入速度。样本干净并不能证明完整市场覆盖、长期历史、公司行动连续性或数据导出权利。

Control the biases that break options backtests控制会破坏期权回测的关键偏差

Rebuild the point-in-time contract universe重建严格时点的可选合约全集

At each decision time, select only contracts that were listed and observable then. Retain expired, delisted, and adjusted contracts instead of joining a present-day chain backward. Record listing date, expiration, root, multiplier, deliverable, settlement, and adjustment status so corporate actions do not silently change the instrument.

在每个决策时点,只能从当时已经挂牌且可见的合约中筛选。必须保留已到期、退市和调整后合约,不能把今天的期权链向历史日期反向拼接。记录挂牌日、到期日、root 代码、乘数、交割物、结算方式与调整状态,避免公司行动悄悄改变合约含义。

Keep every market-data clock separate分别保存每一种市场数据时间

A row can contain a fresh quote, an older last trade, prior-session open interest, and Greeks calculated later by a vendor. Store quote, trade, open-interest, underlying, analytics, and receipt times separately. The strategy may use a field only if its source time was available before the simulated decision.

同一行可能包含刚更新的报价、更早的最近成交、上一交易日未平仓量,以及供应商稍后计算的希腊值。报价、成交、未平仓量、标的行情、分析值和接收时间都应分开保存;只有源时间早于模拟决策时刻的字段,策略才可以使用。

Model contract selection before fills先模拟合约筛选,再模拟成交

If a rule chooses the nearest 30-delta call or 45-day contract, compute that choice from the contemporaneous chain and the model inputs available then. Do not use a vendor's revised Greek or a contract that became liquid later. Save the candidate set and rejection reasons with every signal.

如果规则选择最接近 30 Delta 的认购期权或距到期 45 天的合约,就必须基于当时期权链和当时可用的模型输入完成筛选。不能使用供应商后来修订的希腊值,也不能选择之后才获得流动性的合约。每个信号都应保存候选集和排除原因。

Use executable fill assumptions采用可执行的成交假设

  • Reject crossed, locked, stale, or zero-sided quotes unless the strategy defines a special rule.
  • Model buys from the ask side and sells from the bid side, then test midpoint and adverse-slippage scenarios separately.
  • Cap order size by displayed size or a documented participation rule.
  • Include contract multiplier, commissions, exchange fees, assignment, exercise, and early-exercise logic.
  • Do not fill after the last valid quote or outside the simulated market session.
  • 除非策略另有明确规则,否则应拒绝交叉报价、锁定报价、陈旧报价和单边为零的报价。
  • 买入从卖价侧建模,卖出从买价侧建模,再单独测试中间价和不利滑点情景。
  • 订单规模受显示挂单量或明确的参与率规则约束。
  • 计入合约乘数、佣金、交易所费用、指派、行权和提前行权逻辑。
  • 最后一条有效报价之后或模拟交易时段之外不得成交。

Separate research, validation, and test periods严格划分研究、验证和测试区间

Tune contract filters, volatility rules, and slippage assumptions only on the research period. Freeze the strategy before validation and keep a final untouched test period. Report results by regime, liquidity bucket, expiration type, and spread cost—not only one aggregate return.

合约筛选、波动率规则和滑点假设只能在研究区间调整;进入验证区间前冻结策略,并保留最终未接触的测试区间。结果应按市场状态、流动性分组、到期类型和价差成本分别报告,而不能只展示一个汇总收益率。

Python example: reject unrealistic option rowsPython 示例:剔除不合理的期权数据

Normalize the chain before selecting a contract. This local example keeps valid markets, computes a midpoint, and rejects crossed quotes.

选择合约前,应先将期权链标准化。以下本地示例仅保留有效报价、计算中间价,并剔除买价高于卖价的异常数据。

import pandas as pd

df = pd.read_csv("options_quotes.csv")
df["timestamp"] = pd.to_datetime(df["timestamp"], utc=True)
df = df.dropna(subset=["timestamp", "expiration", "strike", "bid", "ask"])
df = df[(df["bid"] >= 0) & (df["ask"] >= df["bid"])]
df["mid"] = (df["bid"] + df["ask"]) / 2
df = df.sort_values(["timestamp", "contract"]).drop_duplicates(
    ["timestamp", "contract"], keep="last"
)
print(df[["timestamp", "contract", "bid", "ask", "mid"]].tail())
Step步骤Why it matters为什么重要Minimum check最低检查项
Universe可选合约集Selection must use contracts listed at that timestamp.筛选时只能使用该时点已经挂牌的合约。Expiration, strike, side, listing history.到期日、行权价、期权类型、挂牌历史。
Quote报价A last trade may be stale or outside the live spread.最近一笔成交的时效可能不足,成交价甚至可能落在当时的买卖价差之外。Bid ≤ ask, age, size, exchange time.买价不高于卖价、报价时效、报价数量、交易所时间戳。
Fill成交假设Midpoint fills can overstate executable P&L.假设所有订单均以中间价成交,可能会高估实际可实现的损益。Spread rule, slippage, fees, multiplier.买卖价差规则、滑点、费用、合约乘数。

Use QVeris to compare options-data capabilities使用 QVeris 比较期权数据能力

The exact QVeris Options Chain Tool is strongly relevant for inspecting the shape of a current chain: its public record includes calls and puts by expiration and strike with last price, bid, ask, volume, and open interest. It does not by itself prove point-in-time history, expired-contract retention, revision policy, or backtest licensing.

QVeris Options Chain 工具适合检查当前期权链的返回结构:其公开记录包含按到期日和行权价组织的认购、认沽合约,以及最新成交价、买价、卖价、成交量和未平仓量。但这并不能证明它提供严格时点历史、保留已到期合约、具有明确更正政策或允许用于回测。

  • Use the QVeris Playground to inspect one known symbol and expiration before mapping a schema.
  • Ask explicitly for historical dates and expired contracts; never infer history from a current result.
  • Save the tool ID, request, raw response, retrieval time, validation decision, and rejected assumptions.
  • 映射数据结构前,先在 QVeris Playground 中检查一个已知标的和到期日。
  • 明确测试历史日期和已到期合约,绝不能由当前结果推断历史能力。
  • 保存工具 ID、请求、原始响应、抓取时间、校验结论和被否定的假设。

FAQ常见问题

Where can I get free options data for backtesting?

Use provider samples, a hosted platform with included data, or a documented API free tier for a narrow set of historical contracts.

Is free data enough for a serious backtest?

It can validate a workflow or narrow hypothesis, but broad chains, expired contracts, quote history, and export rights are commonly limited or paid.

Can I fill at the midpoint?

Use midpoint only as a sensitivity case. A base case should reflect side, spread, displayed size, slippage, fees, and quote age.

Why are expired contracts essential?

Removing them changes the historical opportunity set and creates survivorship bias, especially around illiquid or adjusted contracts.

哪里能获得免费的期权回测数据?

可使用供应商样本、包含数据的托管平台,或面向少量历史合约且文档清晰的 API 免费套餐。

免费数据足以支持严谨的回测吗?

它可以用于验证工作流或范围较窄的假设,但完整期权链、已到期合约、历史报价和导出权限通常受限或需要付费。

可以按中间价模拟成交吗?

中间价只能作为敏感性情景。基准成交模型应考虑买卖方向、价差、显示挂单量、滑点、费用和报价年龄。

为什么必须保留已到期合约?

删除已到期合约会改变历史时点的可选集合并造成存续偏差,对低流动性或调整后合约尤其明显。

References and next steps参考资料与下一步

QuantConnect plans
QuantConnect options documentation
Historical Option Data samples
Alpha Vantage historical options

QuantConnect 套餐
QuantConnect 期权文档
Historical Option Data 样本
Alpha Vantage 历史期权