跳轉到

資料來源層

資料來源層的任務只有一個:

把外部資料來源完整、可靠地收進公司內部世界。

來源類型

市場資料供應商

例如:

  • Databento
  • Polygon
  • dxFeed
  • Bloomberg

常見資料:

  • trades
  • quotes
  • bars
  • order book
  • reference data

券商行情資料

例如:

  • IBKR
  • Shioaji
  • Alpaca

這類來源容易接,但通常不適合當唯一正式市場資料來源。

券商執行事件

例如:

  • order ack
  • partial fill
  • fill
  • cancel reject
  • account update
  • position update

這些事件也應納入資料平台,而不是只留在下單模組裡。

交易所 WebSocket / REST

常見於 crypto:

  • Binance
  • OKX
  • Bybit

歷史檔案資料

適合:

  • 回測
  • replay
  • 補資料
  • 重算 features

公司行為、基本面與新聞

這類資料更新頻率不一定高,但會直接影響回測與研究正確性。

設計原則

1. 不要太早清洗

原始 payload 要盡量保留,避免未來無法重 parse 或追查 vendor 問題。

2. 每個 source 都要有 identity

至少應追蹤:

  • source_name
  • source_type
  • market
  • channel
  • connector_version
  • raw_symbol
  • account_id 或 session_id

3. 不讓策略直接依賴 source schema

策略應讀 canonical event,而不是直接讀 polygon_tradeibkr_tick