市場數據供應商研究:美國與香港股票/期權數據比較
Version: 2026-10-14
語言:繁體中文
用途: 期權/市場數據平台研究
日期: 2026 年 10 月 14 日
狀態: 研究/架構規劃
主要目標: 比較美國及香港股票與期權的市場數據供應商,包括價格、歷史數據覆蓋、即時數據、公司行動、授權條款,以及是否適合用於回測或商業應用。
重要: 價格、交易所數據權限及授權條款可能隨時改變。在訂閱數據服務,或把數據用於商業/面向客戶的系統之前,必須向供應商及交易所確認最新條款。
1. Executive Summary
Section titled “1. Executive Summary”對於一個以兼職方式開發、重點放在期權研究、策略計算、篩選及回測的項目,建議採用以下方式:
Recommended Development Path
Section titled “Recommended Development Path”階段 0 — Prototype
Section titled “階段 0 — Prototype”首先使用免費方案:
- Massive (formerly Polygon.io) — US stocks / US options
- EODHD — global stocks / 香港股票 / dividends / splits / 基本面
大約成本:
US$0/month
目標是在花費大量金錢購買市場數據之前,先把軟件架構建立起來。
階段 1 — Development
Section titled “階段 1 — Development”建議組合:
- Massive Options Starter
- EODHD paid plan if required
大約成本:
US$50–60/month
這個階段可用於:
- option chain testing
- Greeks
- implied volatility
- open interest
- historical candles
- corporate actions
- strategy calculation
- first version of the backtest engine
階段 2 — 回測ing
Section titled “階段 2 — 回測ing”Upgrade to:
- Massive Options Developer
- EODHD for stock / global / HK data
大約成本:
~US$100/month
這個階段的目的,是取得更深入的歷史期權數據,並進行較貼近真實交易情況的策略回測。
階段 3 — Serious Options 研究
Section titled “階段 3 — Serious Options 研究”可考慮:
- Massive Advanced
- Intrinio
- Databento
- FirstRate Data 歷史數據集
大約成本:
US$200–350+/month, depending on data requirements.
階段 4 — Commercial System
Section titled “階段 4 — Commercial System”If the application becomes:
- multi-user
- customer-facing
- subscription-based
- used by students/clients
- redistributing exchange data
那麼 個人方案一般已經不足夠。
必須進一步研究商業/企業授權。
香港市場的交易所授權費用,可能會明顯高於美國市場數據。
2. Recommended Overall Strategy
Section titled “2. Recommended Overall Strategy”最實際的做法是:
先做美國市場 ↓建立平台 ↓驗證計算 ↓建立回測 ↓穩定架構 ↓加入香港股票 ↓研究香港期權授權主要原因並不是程式開發的複雜程度。
真正的主要限制包括:
- 市場數據授權
- 交易所費用
- 歷史期權數據的可取得程度
- 再分發權
- 商業使用限制
美國市場數據一般較容易取得,而且成本較低。
香港期權數據則明顯較難取得,而且成本高得多。
3. Data Required by the Platform
Section titled “3. Data Required by the Platform”系統應把市場數據視為多個獨立類別來處理。
3.1 Equity Price Data
Section titled “3.1 Equity Price Data”可能需要的欄位包括:
- symbol
- exchange
- trading date
- timestamp
- open
- high
- low
- close
- adjusted close
- volume
- VWAP
- number of trades
時間週期可能包括:
- daily
- hourly
- 30-minute
- 15-minute
- 5-minute
- 1-minute
- tick-level
3.2 Corporate Actions
Section titled “3.2 Corporate Actions”所需的公司行動數據包括:
- 現金股息
- 特別股息
- 拆股
- 反向拆股/合股
- 分拆
- 股票代號變更
- 合併
- 除牌
對歷史回測而言,公司行動數據非常重要,否則直接使用原始歷史價格可能會產生誤導性的結果。
3.3 Fundamental Data
Section titled “3.3 Fundamental Data”可能包括以下欄位:
- 市值
- 收入
- EPS
- P/E
- 負債
- 現金流
- ROE
- 利潤率
- 業績公布日期
- 分析師預測
這些資料對股票/策略篩選器很有用,但對第一版期權策略引擎並非必要。
4. Options Data Required
Section titled “4. Options Data Required”每一張期權合約可包括:
UnderlyingExpiryStrikeCall / PutBidAskLastVolumeOpen InterestImplied VolatilityDeltaGammaThetaVegaRhoContract MultiplierExercise StyleSettlement Type較進階的系統還可包括:
Bid SizeAsk SizeTrade TimestampQuote TimestampNBBOIV SurfaceHistorical GreeksHistorical Bid / AskHistorical Open InterestHistorical Option Chain5. Importance of Each 數據類型
Section titled “5. Importance of Each 數據類型”| 數據類型 | 篩選器 | 回測 | 期權引擎 | 優先程度 |
|---|---|---|---|---|
| Daily OHLCV | 是 | 是 | 是 | ★★★★★ |
| Intraday OHLCV | 是 | 是 | 是 | ★★★★★ |
| Adjusted Prices | 是 | 是 | 否 | ★★★★★ |
| Dividends | 否 | 是 | 是 | ★★★★★ |
| Stock Splits | 否 | 是 | 是 | ★★★★★ |
| Earnings | 是 | 是 | 是 | ★★★★ |
| Delisted Stocks | 是 | 是 | 否 | ★★★★ |
| Option Chain | 否 | 是 | 是 | ★★★★★ |
| Bid / Ask | 否 | 是 | 是 | ★★★★★ |
| Volume | 否 | 是 | 是 | ★★★★★ |
| Open Interest | 否 | 是 | 是 | ★★★★★ |
| Implied Volatility | 否 | 是 | 是 | ★★★★★ |
| Greeks | 否 | 是 | 是 | ★★★★★ |
| Historical Option Chain | 否 | 是 | 是 | ★★★★★ |
| Historical Bid / Ask | 否 | 是 | 是 | ★★★★★ |
| Tick Data | Advanced | Advanced | Advanced | ★★★ |
| Level 2 / Order Book | Advanced | Rare | Rare | ★★ |
6. Provider Comparison
Section titled “6. Provider Comparison”| Provider | 美國股票 | 香港股票 | 美國期權 | 香港期權 | 股息/拆股 | 歷史期權 | 一般入門價格 | 最適合用途 |
|---|---|---|---|---|---|---|---|---|
| Massive | ★★★★★ | 否 | ★★★★★ | 否 | 是 | ★★★★★ | Free / 79 / $199+ | US options |
| EODHD | ★★★★ | 是 | ★★★★ | 否 | 是 | ★★★★ | Free / ~$20–100 | 全球股票 |
| Twelve Data | ★★★★ | 是 | 有限 | 否 | 是 | 有限 | Free / 229+ | Global market API |
| Alpha Vantage | ★★★★ | Global | ★★★★ | 否 | 是 | ★★★★ | Free / Premium | 研究 / 原型 |
| Intrinio | ★★★★★ | Mainly US | ★★★★★ | 否 | 是 | ★★★★★ | ~$150+ | Professional options research |
| FMP | ★★★★ | Global on higher plans | 有限 | 否 | 是 | 有限 | Free / 49 / $99+ | Fundamentals |
| Tiingo | ★★★★ | 有限 | 有限 | 否 | 是 | 有限 | Free / ~$30+ | Stocks / internal research |
| AllTick | 是 | ★★★★★ | 有限 | 不明確 | 有限 | 有限 | ~$99–399 USDT | HK 即時數據 |
| Databento | ★★★★★ | 否 | ★★★★★ | 否 | 有限 | ★★★★★ | 按用量收費 | Institutional / quant |
| FirstRate Data | ★★★★ | 否 | ★★★★★ | 否 | 有限 | ★★★★★ | Dataset / ~$79 update | Historical backtest |
| IBKR API | ★★★★ | ★★★★ | ★★★★ | Depends on entitlement | 有限 | 有限 | Exchange subscriptions | 交易執行 / live |
| Webull API | ★★★★ | ★★★★ | 美國期權 | 有限 | 有限 | 有限 | Subscription / entitlement | Broker-linked data |
| HKEX | HK 官方 | ★★★★★ | N/A | ★★★★★ | 官方 | ★★★★★ | 高 | 官方 HK data |
7. Massive
Section titled “7. Massive”前稱 Polygon.io。
網站:
7.1 Strengths
Section titled “7.1 Strengths”Massive 是開發美國期權系統時其中一個最值得考慮的選擇。
數據覆蓋包括:
- US 股票
- US options
- historical aggregates
- trades
- quotes
- snapshots
- option chains
- Greeks
- implied volatility
- open interest
- WebSocket feeds
7.2 Options Basic
Section titled “7.2 Options Basic”Approximate price:
US$0/month
常見功能包括:
- US option contracts
- 參考數據
- 有限歷史數據
- 收市數據
- 分鐘聚合數據
- corporate actions
- API 速率限制
最適合:
- 原型
- Schema 開發
- 早期策略計算
7.3 Options Starter
Section titled “7.3 Options Starter”Approximate price:
US$29/month
通常額外包括:
- 不限 API 呼叫次數
- 延遲市場數據
- Greeks
- IV
- open interest
- snapshots
- WebSocket
- second aggregates
- flat files
最適合:
- development
- 即時測試
- 期權篩選器
7.4 Options Developer
Section titled “7.4 Options Developer”Approximate price:
US$79/month
主要優勢:
- 更深入的歷史期權覆蓋
- trades
- 更適合回測
當回測引擎開始實際運作後,這很可能是第一個值得付費使用的方案。
7.5 Options Advanced
Section titled “7.5 Options Advanced”Approximate price:
US$199/month
通常額外包括:
- 即時數據
- 更深入的歷史數據存取
- quotes
- trades
最適合:
- 深入研究
- 即時分析
7.6 Massive Licensing
Section titled “7.6 Massive Licensing”這一點非常重要。
低價方案一般只供個人/非專業用途。
面向客戶的應用程式可能需要:
- 商業授權
- 交易所授權
- 展示權
- 再分發權
不要假設每月 US79 的個人訂閱方案容許你把原始市場數據展示給客戶。
8. EODHD
Section titled “8. EODHD”網站:
EODHD 特別適合需要全球股票市場覆蓋的情況。
8.1 Strengths
Section titled “8.1 Strengths”數據覆蓋包括:
- 全球股票
- 香港股票
- 收市價格
- 日內價格
- dividends
- splits
- 基本面
- 業績
- news
- 技術指標
- US options
8.2 Free Plan
Section titled “8.2 Free Plan”常見功能包括:
- limited API calls
- recent historical data
- EOD
- dividends
- splits
最適合:
- 原型
- 概念驗證
8.3 Paid Plans
Section titled “8.3 Paid Plans”較高級方案可能包括:
- 30+ years of historical data
- intraday data
- 基本面
- 延遲即時數據
- 股票篩選
- 更高 API 用量
All-in-One pricing has historically been around:
US$99.99/month
訂閱前應再次確認最新價格。
8.4 美國期權
Section titled “8.4 美國期權”EODHD 的期權數據可能包括:
- OHLC
- bid
- ask
- bid size
- ask size
- volume
- open interest
- open-interest changes
- implied volatility
- delta
- gamma
- theta
- vega
- rho
- theoretical price
- moneyness
- DTE
因此,對較小型的系統而言,EODHD 有機會減少所需數據供應商的數量。
9. Intrinio
Section titled “9. Intrinio”網站:
Intrinio 價格較高,但更適合認真的期權分析工作。
9.1 Individual Plan
Section titled “9.1 Individual Plan”大約起步價:
US$150/month
可能包括:
- US 基本面
- historical stocks
- options history
- tick-level data
- Greeks
- IV
- OptionsEdge products
9.2 Commercial / Startup
Section titled “9.2 Commercial / Startup”商業方案的起步價可能高出很多。
商業方案可能包括:
- 商業用途
- 展示權
- larger API limits
- 多名用戶
通常要到軟件已證明具有商業價值之後,這類方案才值得考慮。
9.3 歷史期權
Section titled “9.3 歷史期權”可能包括以下欄位:
- 期權收市價
- 收市 Bid
- 收市 Ask
- volume
- open interest
- IV
- Greeks
- 完整期權鏈
- 波動率曲面
大量歷史數據集的時間跨度,可能比一般 API 產品長得多。
10. Alpha Vantage
Section titled “10. Alpha Vantage”網站:
Stocks:
- daily
- weekly
- monthly
- intraday
- adjusted / unadjusted
- dividends
- splits
Options:
- current options chain
- historical options
- Greeks
- implied volatility
Alpha Vantage 適合:
- research
- 原型
- long-term historical experiments
如作商業用途,應另外確認授權條款。
11. Twelve Data
Section titled “11. Twelve Data”網站:
Twelve Data 在全球市場覆蓋方面表現不錯。
Free
適合:
- development
- small API usage
- US 股票
- forex
- crypto
Approximate price:
US$79/month
可能包括:
- global markets
- US 股票
- EOD international 股票
- 基本面
- dividends
- splits
- 業績
Approximate price:
US$229/month
另外包括:
- more global exchanges
- higher limits
- more 即時數據/delayed markets
Approximate price:
US$999/month
適合較高用量的情況。
個人方案一般只供個人/內部非商業用途。
如向外部分發數據,通常需要商業授權。
12. Financial Modeling Prep
Section titled “12. Financial Modeling Prep”網站:
https://financialmodelingprep.com/
FMP 特別擅長基本面及公司財務數據。
| Plan | 大約每月成本 |
|---|---|
| Basic | Free |
| Starter | ~$19 |
| Premium | ~$49 |
| Ultimate | ~$99 |
可能提供的數據包括:
- financial statements
- ratios
- estimates
- 業績
- historical prices
- ETF data
- 13F data
- transcripts
- 全球股票
FMP 較適合:
- 股票篩選
- 基本面
- company research
如果要建立專門的期權引擎,它並不是首選。
13. Tiingo
Section titled “13. Tiingo”網站:
主要優勢:
- US 股票
- 長期歷史數據覆蓋
- 調整後價格
- 適合研究的 API
大約付費價格:
~US$30/month
重要:
部分 Tiingo 方案只供內部使用。
如向外分享或再分發數據,可能需要另外取得授權。
14. AllTick
Section titled “14. AllTick”網站:
AllTick 對香港即時市場數據而言值得留意。
Possible Plans
Section titled “Possible Plans”Approximate price:
99 USDT/month
可能包括:
- 指定產品
- 即時 tick
- Order Book/訂單簿
- K-lines
Premium
Section titled “Premium”Approximate price:
199 USDT/month
可使用更多股票代號。
Professional
Section titled “Professional”Approximate price:
399 USDT/month
市場覆蓋範圍更大。
Hong Kong Stock Package
Section titled “Hong Kong Stock Package”Approximate price:
399 USDT/month
可能涵蓋數千個香港市場代號,並提供:
- 即時報價
- Order Book/訂單簿
- ticks
- K-lines
授權注意事項
Section titled “授權注意事項”技術上能夠取得數據,並不代表授權上自動容許商業再分發。
在商業系統中使用 AllTick 前,應確認:
- 商業用途
- 展示權
- 再分發權
- exchange-authorised status
- derived-data rules
15. Databento
Section titled “15. Databento”網站:
Databento 主要為量化研究及機構級工作負載而設。
- tick data
- trades
- quotes
- NBBO
- OPRA options
- 高質素歷史數據
- 交易所原生數據 Schema
Databento 的收費通常由以下部分組成:
Data Usage+Exchange Licence+Professional / 否n-professional Entitlements這與一般固定月費的 SaaS 模式不同。
Databento 適合:
- 量化研究
- 專業回測
- 市場微結構研究
- tick-level 模擬
- 機構級數據集
對本項目的第一個版本而言,可能沒有必要使用。
16. FirstRate Data
Section titled “16. FirstRate Data”網站:
如果主要目標是以下用途,FirstRate Data 特別值得考慮:
historical backtesting
而不是即時數據串流。
Potential Data
Section titled “Potential Data”- 歷史期權鏈
- bid
- ask
- open interest
- implied volatility
- Greeks
- volume
- historical underlyings
覆蓋範圍可能包括:
- 現役股票代號
- 已除牌股票代號
- 更早期的歷史數據
為甚麼歷史數據集可能更合適
Section titled “為甚麼歷史數據集可能更合適”與其為每次 API 請求付費,可以:
購買/訂閱數據集 ↓下載 ↓本地儲存 ↓Convert to Parquet ↓回測 Locally這種方式非常適合大規模回測。
17. IBKR 市場數據 API
Section titled “17. IBKR 市場數據 API”網站:
https://www.interactivebrokers.com/
IBKR 非常適合:
- 券商服務
- 交易執行
- 即時驗證
- 即時帳戶持倉
- 自動交易
不過,它並不適合作為主要的長期歷史數據庫。
Massive / EODHD / Dataset Provider ↓ 研究 ↓ 回測ing ↓ 策略訊號 ↓ IBKR ↓ 交易執行建議把 IBKR 用作交易執行層,而不是核心歷史數據倉庫。
18. Webull / Moomoo / Broker APIs
Section titled “18. Webull / Moomoo / Broker APIs”券商 API 可能提供:
- US stocks
- 香港股票
- US options
- 即時報價
- delayed quotes
- 帳戶資料
- 訂單
不過:
- 歷史數據深度可能有限
- 可能有速率限制
- 再分發權可能受到限制
- 市場數據可能需要帳戶權限
- API 可能主要為交易而設,而不是大量研究
這類 API 較適合:
即時交易交易執行帳戶狀態目前報價而不是用來建立大型歷史研究數據庫。
19. Hong Kong 市場數據
Section titled “19. Hong Kong 市場數據”香港市場數據應與美國市場數據分開處理。
最大的挑戰是:
licensing
而不是軟件開發本身。
20. HKEX
Section titled “20. HKEX”網站:
HKEX(香港交易所)是香港市場數據的官方來源。
可能提供的數據類別包括:
- 股票
- 衍生產品
- 股票期權
- 期貨
- trades
- quotes
- Order Book/訂單簿s
- 歷史數據集
21. HKEX Real-Time Licensing
Section titled “21. HKEX Real-Time Licensing”商業再分發可能涉及高昂的交易所授權費。
例如,授權架構可能按季收取以下數據服務費:
- Securities Standard
- Securities Premium
- Securities FullTick
- delayed data
這些費用每季可能高達數萬港元。
額外成本還可能包括:
- 連線費
- 訂閱者費用
- 終端費
- 供應商費
- 再分發費
22. HKEX Historical Data Marketplace
Section titled “22. HKEX Historical Data Marketplace”HKEX 提供官方歷史數據集。
可能的產品包括:
- 收市數據
- 成交數據
- 完整 Order Book 數據
- 衍生產品數據
- 期權數據
歷史數據集可能與現行市場數據訂閱分開出售。
這個分別非常重要:
Current Market Subscription≠Historical Archive Purchase全市場歷史數據集的成本可以相當高。
23. Why 香港期權 Are Difficult
Section titled “23. Why 香港期權 Are Difficult”很多價格較低的數據 API 支援:
美國股票 ✓美國期權 ✓香港股票 ✓香港期權 ✗原因通常與交易所授權有關。
香港期權可能涉及:
- HKEX licensing
- 專門供應商
- 商業展示權
- 按用戶收費
- 再分發限制
因此,應該等平台穩定之後才加入香港期權。
24. Licensing Levels
Section titled “24. Licensing Levels”系統應區分以下四個使用層級。
Level 1 — 個人研究
Section titled “Level 1 — 個人研究”例子:
Harry 在本地執行 Python↓下載數據↓進行研究↓否 one else sees raw market data很多個人方案都適合這種用途。
Level 2 — 私人內部工具
Section titled “Level 2 — 私人內部工具”例子:
Harry+項目合作夥伴+小型內部團隊這種情況可能已超出嚴格定義的「個人使用」授權範圍。
應向供應商確認是否獲准。
Level 3 — 面向客戶的應用程式
Section titled “Level 3 — 面向客戶的應用程式”例子:
用戶登入↓選擇股票↓系統顯示期權鏈↓顯示 Bid/Ask/Greeks/IV這屬於商業展示。
可能需要商業授權或交易所授權。
Level 4 — 再分發
Section titled “Level 4 — 再分發”API 輸出例子:
{ "symbol": "AAPL", "expiry": "2026-11-20", "strike": 250, "type": "CALL", "bid": 5.20, "ask": 5.35, "iv": 0.312, "delta": 0.42}如果把這些原始或接近原始的市場數據提供給外部用戶,可能會被視為再分發。
這是授權限制最嚴格的類別。
25. Derived Data
Section titled “25. Derived Data”一個非常重要的設計原則,是把原始市場數據與衍生分析結果分開。
例子:
原始市場數據 ↓Calculation Engine ↓Strategy Analytics ↓衍生結果與其直接顯示:
Bid = $5.20Ask = $5.35IV = 31.2%Delta = 0.42應用程式可以改為顯示:
Strategy: Bull Put Spread
Short Put: 200Long Put: 190
Max Profit: $430Max Loss: $570Breakeven: $195.70Probability Estimate: 68%衍生數據的授權規則,有時會與原始市場數據再分發的規則不同。
不過:
不要假設衍生數據一定可以不受限制地使用。
仍然必須查看供應商及交易所的條款。
26. Recommended Software Architecture
Section titled “26. Recommended Software Architecture”flowchart TD
A[市場數據供應商]
A --> B1[Massive] A --> B2[EODHD] A --> B3[香港供應商] A --> B4[歷史數據集]
B1 --> C[供應商 Adapter 層] B2 --> C B3 --> C B4 --> C
C --> D[否rmalized 市場數據 Schema]
D --> E1[股票市場數據庫] D --> E2[期權數據庫] D --> E3[公司行動數據庫] D --> E4[基本面數據庫]
E1 --> F[計算引擎] E2 --> F E3 --> F E4 --> F
F --> G1[策略引擎] F --> G2[回測 Engine] F --> G3[篩選器] F --> G4[風險引擎]
G1 --> H[結果 API] G2 --> H G3 --> H G4 --> H
H --> I1[Web UI] H --> I2[報告] H --> I3[交易訊號] H --> I4[券商整合]27. Three-Layer Core Architecture
Section titled “27. Three-Layer Core Architecture”一個簡單的概念模型:
flowchart LR
A[數據層] --> B[計算層] B --> C[輸出層]
A --> A1[股票] A --> A2[Options] A --> A3[公司行動]
B --> B1[Greeks] B --> B2[策略] B --> B3[風險] B --> B4[回測]
C --> C1[UI] C --> C2[報告] C --> C3[提示] C --> C4[券商訂單]28. 回測ing Should Be a Separate Module
Section titled “28. 回測ing Should Be a Separate Module”平台應包含四個主要而且彼此獨立的系統:
flowchart TD
A[數據收集] --> B[數據儲存] B --> C[計算引擎]
C --> D[策略引擎] C --> E[回測 Engine] C --> F[篩選器 Engine]
D --> G[輸出] E --> G F --> G回測不應直接與即時策略計算混在一起。
29. Provider-Neutral Design
Section titled “29. Provider-Neutral Design”不要把供應商專用程式碼散落在整個系統。
不理想的設計:
polygon.get_options()polygon.get_candles()eodhd.get_dividend()並散佈於應用程式的不同部分。
應改為定義一個共用介面。
例子:
class MarketData供應商:
def get_candles(self, symbol, start, end, interval): pass
def get_dividends(self, symbol, start, end): pass
def get_splits(self, symbol, start, end): pass
def get_option_chain(self, symbol, expiry=否ne): pass
def get_option_quotes(self, contracts): pass然後實作:
MassiveProviderEodhdProviderIntrinioProviderAllTickProviderHKEXProvider計算引擎不應需要知道數據來自哪一個供應商。
30. 否rmalized Data Schema
Section titled “30. 否rmalized Data Schema”股票 K 線模型例子:
marketexchangesymboltimestampintervalopenhighlowcloseadjusted_closevolumevwapprovider期權合約模型例子:
marketunderlyingcontract_symbolexpirystrikeoption_typebidasklastvolumeopen_interestimplied_volatilitydeltagammathetavegarhotimestampprovider31. Suggested Database Layout
Section titled “31. Suggested Database Layout”可考慮使用:
PostgreSQL + TimescaleDB
資料表:
symbolsstock_candlescorporate_actionsdividendsstock_splitsoption_contractsoption_quotesoption_tradesoption_greeks業績基本面provider_metadata對非常大量的歷史數據:
Parquet
通常會更有效率。
建議方式:
PostgreSQL / TimescaleDB → metadata → current data → indexed research queries
Parquet → large historical options → historical stock candles → bulk backtests32. Historical Data Storage Strategy
Section titled “32. Historical Data Storage Strategy”flowchart LR
A[供應商 API/Flat File] --> B[原始數據儲存] B --> C[驗證] C --> D[否rmalization] D --> E1[PostgreSQL] D --> E2[Parquet] E1 --> F[研究] E2 --> G[回測ing]理想情況下,在轉換數據之前應保留原始數據。
這樣在以下情況出現時,可以日後重新修正:
- provider schema changes
- normalization logic changes
- adjusted price logic changes
- corporate action handling changes
33. Suggested Development 階段s
Section titled “33. Suggested Development 階段s”階段 0 — 架構
Section titled “階段 0 — 架構”Goal:
先在不購買付費數據的情況下建立系統。
工作項目:
- define interfaces
- define database schema
- implement provider adapter
- implement data normalization
- create mock data
- connect Massive Free
- connect EODHD Free
成本:
US$0
階段 1 — 股票數據引擎
Section titled “階段 1 — 股票數據引擎”實作:
- symbols
- OHLCV
- corporate actions
- dividends
- splits
- 調整後價格
- delisted-symbol handling
供應商:
- EODHD
- Massive
階段 2 — 期權數據引擎
Section titled “階段 2 — 期權數據引擎”實作:
- option chain
- expiry
- strike
- call / put
- bid / ask
- IV
- Greeks
- volume
- open interest
供應商:
Massive
階段 3 — 策略引擎
Section titled “階段 3 — 策略引擎”實作常見期權策略:
Long CallLong PutShort CallShort Put
Covered CallCash-Secured Put
Bull Call SpreadBear Call Spread
Bull Put SpreadBear Put Spread
Long StraddleLong Strangle
Iron CondorIron Butterfly
Calendar SpreadDiagonal Spread
Box Spread階段 4 — 回測引擎
Section titled “階段 4 — 回測引擎”回測引擎應支援:
Entry DateEntry TimeExpiryStrike SelectionDelta SelectionPremiumBid / AskSlippageCommissionAssignmentExerciseEarly ExitProfit TargetStop LossRollingExpiration階段 5 — 美國歷史期權數據
Section titled “階段 5 — 美國歷史期權數據”升級至更深入的期權數據集。
可選擇:
- Massive Developer
- Intrinio
- FirstRate Data
- Databento
階段 6 — 香港股票
Section titled “階段 6 — 香港股票”加入:
- HK symbols
- HK OHLCV
- dividends
- splits
- corporate actions
- HK market calendars
可評估的供應商:
- EODHD
- Twelve Data
- AllTick
- HKEX
階段 7 — 香港期權
Section titled “階段 7 — 香港期權”只應在確認實際需求之後進行。
工作項目:
- identify exact instruments
- identify historical-depth requirements
- identify 即時數據 requirements
- obtain vendor quotes
- check HKEX licensing
- confirm 再分發權
- estimate per-user costs
34. Cost Roadmap
Section titled “34. Cost Roadmap”| 階段 | 主要供應商 | 大約每月成本 |
|---|---|---|
| Prototype | Massive Free + EODHD Free | $0 |
| Development | Massive Starter + EODHD | ~$50–60 |
| 回測ing | Massive Developer + EODHD | ~$100 |
| Advanced 研究 | Massive Advanced / Intrinio | ~$200–350+ |
| Commercial | Business plans | Quote required |
| HK Commercial | HK vendor + HKEX rights | Potentially high |
35. 建議供應商 Ranking
Section titled “35. 建議供應商 Ranking”1. Massive
Section titled “1. Massive”在以下方面取得最佳平衡:
- price
- API quality
- options coverage
- historical data
- developer experience
2. Intrinio
Section titled “2. Intrinio”最適合:
- professional analytics
- commercial projects
- higher-quality options research
3. Alpha Vantage
Section titled “3. Alpha Vantage”適合:
- research
- longer historical experiments
4. EODHD
Section titled “4. EODHD”如果希望以較少供應商整合多個市場,這是一個可考慮的選擇。
36. Global / Hong Kong Stocks
Section titled “36. Global / Hong Kong Stocks”1. EODHD
Section titled “1. EODHD”整體而言,在以下方面取得良好平衡:
- global coverage
- historical data
- corporate actions
- 基本面
2. Twelve Data
Section titled “2. Twelve Data”不錯的全球市場 API。
3. AllTick
Section titled “3. AllTick”適合進一步研究香港即時數據。
授權方面仍需進一步盡職調查。
37. 歷史期權 回測ing
Section titled “37. 歷史期權 回測ing”建議候選名單:
Massive
Section titled “Massive”API 與 flat-file 生態都不錯。
Intrinio
Section titled “Intrinio”提供高質素的專業期權數據集。
FirstRate Data
Section titled “FirstRate Data”對離線歷史回測很有吸引力。
Databento
Section titled “Databento”最適合進階量化/tick-level 分析。
38. Commercial Application
Section titled “38. Commercial Application”如開發商業產品,可考慮:
- Massive Business
- Intrinio Commercial
- Databento
- authorised exchange vendors
不要假設個人方案容許商業展示。
39. Hong Kong Options
Section titled “39. Hong Kong Options”建議方式:
HKEXorHKEX-authorised vendor在確認授權及數據來源之前,不應依賴便宜但非官方的 API。
40. Key Questions to Ask Every Provider
Section titled “40. Key Questions to Ask Every Provider”訂閱之前,可向供應商查詢以下問題。
1. 你們是否提供美國股票數據?2. 你們是否提供香港股票數據?3. 你們是否提供美國股票期權數據?4. 你們是否提供香港股票期權數據?5. 可提供多少年的歷史數據?6. 是否包括已除牌股票?7. 是否包括公司行動數據?8. 是否提供完整歷史期權鏈數據?9. 是否包括歷史 Bid/Ask 報價?10. Open Interest 是歷史數據,還是只有目前數值?11. Greeks 是否有歷史數據,還是只為目前期權鏈計算?12. 是否提供歷史 Implied Volatility?13. 是否提供成交數據?14. 是否提供報價數據?15. 是否提供 NBBO?16. 此方案是否只供個人使用?17. 多名內部用戶可否存取數據?18. 可否在私人 Web 應用程式內展示數據?19. 可否向付費客戶展示數據?20. 是否容許再分發?21. 是否容許展示衍生分析結果?22. 價格是否已包括交易所費用?23. 是否需要按每名用戶支付交易所費用?24. 數據可否永久儲存?25. 取消訂閱後,可否繼續保存已下載的歷史數據?41. Example Provider Email
Section titled “41. Example Provider Email”Subject: 市場數據 Licensing and 歷史期權 Questions
你好,
我們正在評估貴公司的市場數據服務,計劃用於一個執行期權策略分析及歷史回測的軟件平台。
可否請你們確認以下事項:
1. 是否提供美國股票期權的歷史期權鏈。2. 是否包括歷史 Bid、Ask、Volume、Open Interest、IV 及 Greeks。3. 最長可提供多少年的歷史數據。4. 已下載的歷史數據可否永久保存作內部研究。5. 訂閱方案是否容許多名內部用戶使用。6. 衍生分析結果可否展示給外部客戶。7. 原始或延遲市場數據可否展示給外部客戶。8. 是否需要另外支付交易所授權費或再分發費。9. 是否提供香港股票或香港股票期權數據。10. 商業方案的價格是否與個人方案不同。
謝謝。42. Final Recommendation
Section titled “42. Final Recommendation”對目前這個項目,建議採用以下路線:
由以下組合開始
Section titled “由以下組合開始”Massive FREE+EODHD FREE暫時不要訂閱昂貴的市場數據服務。
首先建立:
Data Adapter↓否rmalized Schema↓Calculation Engine↓Strategy Engine↓回測 Engine↓Output當歷史期權回測已經能夠正常運作後:
Massive Options DeveloperHong Kong Stocks可使用:
- EODHD
- Twelve Data
- AllTick
但必須先確認授權。
只在較後階段加入:
Hong Kong Options並先完成:
- validating product demand
- obtaining vendor quotations
- confirming HKEX licensing requirements
- confirming 再分發權
43. Recommended Architecture Principle
Section titled “43. Recommended Architecture Principle”項目應一直保持以下分層:
數據 ↓計算 ↓輸出各層互相分離。
這樣做有以下好處:
- 可以更換數據供應商
- 較容易控制授權
- 回測保持獨立
- 即時交易保持獨立
- 商業輸出可與原始市場數據分離
- 平台可以先由美國數據開始,之後再加入香港數據
44. Suggested Repository Structure
Section titled “44. Suggested Repository Structure”market-platform/│├── apps/│ ├── api/│ ├── web/│ └── worker/│├── packages/│ ├── market-data/│ │ ├── interfaces/│ │ ├── massive/│ │ ├── eodhd/│ │ ├── intrinio/│ │ └── hk/│ ││ ├── calculations/│ │ ├── pricing/│ │ ├── greeks/│ │ └── risk/│ ││ ├── strategies/│ │ ├── vertical-spreads/│ │ ├── condors/│ │ ├── calendars/│ │ └── boxes/│ ││ ├── backtest/│ │ ├── engine/│ │ ├── 交易執行/│ │ ├── slippage/│ │ └── reporting/│ ││ └── storage/│ ├── postgres/│ └── parquet/│├── data/│ ├── raw/│ ├── normalized/│ └── backtest/│└── docs/ ├── MARKET_數據_RESEARCH.md ├── ARCHITECTURE.md └── LICENSING.md45. 研究 Links
Section titled “45. 研究 Links”Massive
Section titled “Massive”Intrinio
Section titled “Intrinio”Alpha Vantage
Section titled “Alpha Vantage”https://www.alphavantage.co/documentation/
Twelve Data
Section titled “Twelve Data”https://twelvedata.com/pricing
Financial Modeling Prep
Section titled “Financial Modeling Prep”https://financialmodelingprep.com/
Tiingo
Section titled “Tiingo”AllTick
Section titled “AllTick”Databento
Section titled “Databento”FirstRate Data
Section titled “FirstRate Data”Interactive Brokers
Section titled “Interactive Brokers”https://www.interactivebrokers.com/
HKEX 市場數據:
https://www.hkex.com.hk/Services/Market-Data-Services
46. Final Decision Table
Section titled “46. Final Decision Table”| 需求 | 建議供應商 |
|---|---|
| 免費原型 | Massive + EODHD |
| 美國股票 K 線 | Massive / EODHD |
| 美國股息/拆股 | EODHD / Massive |
| 全球股票 | EODHD |
| 香港股票 | EODHD / Twelve Data / AllTick |
| 美國期權鏈 | Massive |
| 美國 Greeks/IV | Massive |
| 美國歷史期權 | Massive / Intrinio / FirstRate |
| Tick-level 美國期權 | Databento / Intrinio |
| 券商交易執行 | IBKR |
| 香港即時股票數據 | AllTick / HKEX vendor |
| 香港期權 | HKEX / authorised vendor |
| 商業分發 | Business / exchange licence |
這次研究最重要的結論是:
先以美國市場數據建立系統,保持數據層對供應商中立;香港期權應視為較後階段的授權項目,而不是一開始就要解決的程式開發問題。
建議的初始技術/數據組合是:
Massive+EODHD+PostgreSQL / TimescaleDB+Parquet並採用以下架構:
市場數據↓供應商 Adapter↓否rmalized Storage↓Calculation Engine↓Strategy Engine↓回測 Engine↓Result API↓UI/報告/券商這樣可以把初期開發成本保持在較低水平,同時保留足夠彈性,日後加入:
- more US data providers
- Hong Kong 股票
- Hong Kong options
- commercial licensing
- 即時數據 交易執行
而不需要重新設計核心應用程式。