中国株式市場のLevel-2データ構造:リアルタイム成行、委託情報、10段階板情報

APIデモ環境: https://www.stockapi.com.cn/

対応取引所とデータ種別

取引所 提供データ
上海証券取引所 10段階行情報(Level-2)、注文列情報、リアルタイム約定・注文データ
深圳証券取引所 10段階行情報(Level-2)、注文列情報、リアルタイム約定・注文データ
対象銘柄 A株、ETF、転換社債

データメッセージタイプ

型識別子 内容
TradeEvent 個別約定イベント(ティックデータ)
OrderEvent 新規注文・取消しイベント
OrderBookQueue 買気配・売気配の列情報
MarketSnapshot 10段階市場スナップショット

TradeEvent - 個別約定データ

市場での一回の約定を表す最小単位のデータ。

フィールド 説明
marketId uint32 市場区分: 1=上海, 2=深圳
symbol string 銘柄コード(例: 600000)
timestampMs int64 発生時刻(ミリ秒単位UNIXタイムスタンプ)
tradeId string 約定番号
unitPrice uint32 単価(実際の価格は100で割る)
quantity uint64 約定数量(株単位)
totalAmount uint64 総取引金額(人民元、小数点以下切り捨て)
direction uint32 約定方向: 0=不明, 1=買い主導, 2=売り主導
eventType uint32 イベント種別: 0=約定, 1=取消しによる削除
bidOrderId string 買い側注文ID
askOrderId string 売り側注文ID
{
  "marketId": 1,
  "symbol": "600000",
  "timestampMs": 1623456789012,
  "tradeId": "T123456789",
  "unitPrice": 1000,
  "quantity": 200,
  "totalAmount": 200000,
  "direction": 1,
  "eventType": 0,
  "bidOrderId": "BID_0001",
  "askOrderId": "ASK_0002"
}

OrderEvent - 注文イベント

新規注文または注文取消しの発生を示すデータ。

フィールド 説明
marketId uint32 市場識別子
symbol string 銘柄コード
timestampMs int64 注文時刻(ミリ秒)
orderId string 注文シーケンス番号
orderPrice uint32 注文価格(内部形式)
orderVolume uint64 注文数量
totalValue uint64 注文本体金額(参考)
side uint32 注文サイド: 1=買い, 2=売り
orderType uint32 注文種別: 1=成行, 2=指値, 10=取消し
{
  "marketId": 2,
  "symbol": "000001",
  "timestampMs": 1623456790123,
  "orderId": "ORD_987654",
  "orderPrice": 1250,
  "orderVolume": 500,
  "totalValue": 625000,
  "side": 2,
  "orderType": 2
}

OrderBookQueue - 注文列深さ情報

最良気配における上位注文の分布状況。

フィールド 説明
marketId uint32 市場ID
symbol string 銘柄コード
updateTime int64 更新時刻(ミリ秒)
bestBidPrice uint32 最高買値
bestBidCount uint32 最高買気配の注文件数
bestAskPrice uint32 最低売値
bestAskCount uint32 最低売気配の注文件数
buyLevels uint32[10] 上位10件の買い注文数量リスト
sellLevels uint32[10] 上位10件の売り注文数量リスト
{
  "marketId": 1,
  "symbol": "600036",
  "updateTime": 1623456791000,
  "bestBidPrice": 985,
  "bestBidCount": 85,
  "bestAskPrice": 990,
  "bestAskCount": 92,
  "buyLevels": [85, 78, 70, 65, 60, 55, 50, 45, 40, 35],
  "sellLevels": [92, 95, 100, 105, 110, 115, 120, 125, 130, 135]
}

MarketSnapshot - 10段階市場スナップショット

現在の市場全体状況を10段階で表現したデータ。

フィールド 説明
marketId uint32 市場識別子
symbol string 銘柄コード
snapTime int64 取得時刻(ミリ秒)
sessionStatus uint32 取引セッション状態(0~6)
prevClose uint32 前日終値
openPrice uint32 始値
currentPrice uint32 現在値
highPrice uint32 当日最高値
lowPrice uint32 当日最安値
upperLimit uint32 ストップ高価格
lowerLimit uint32 ストップ安価格
totalTrades uint32 累計約定件数
volumeTraded uint64 出来高(株)
turnover uint64 取引高(元)
totalBidQty uint64 総買い注文数量
weightedBidPrice uint32 加重平均買気配価格
totalAskQty uint64 総売り注文数量
weightedAskPrice uint32 加重平均売気配価格
bidPrices uint32[10] 10段階買気配価格リスト(降順)
bidQtys uint32[10] 10段階買気配数量リスト
askPrices uint32[10] 10段階売気配価格リスト(昇順)
askQtys uint32[10] 10段階売気配数量リスト
{
  "marketId": 1,
  "symbol": "601318",
  "snapTime": 1623456792000,
  "sessionStatus": 3,
  "prevClose": 920,
  "openPrice": 925,
  "currentPrice": 930,
  "highPrice": 935,
  "lowPrice": 920,
  "upperLimit": 1012,
  "lowerLimit": 828,
  "totalTrades": 12500,
  "volumeTraded": 25000000,
  "turnover": 23250000000,
  "totalBidQty": 1200000,
  "weightedBidPrice": 929,
  "totalAskQty": 1180000,
  "weightedAskPrice": 931,
  "bidPrices": [930, 929, 928, 927, 926, 925, 924, 923, 922, 921],
  "bidQtys": [50000, 48000, 45000, 42000, 40000, 38000, 35000, 32000, 30000, 28000],
  "askPrices": [931, 932, 933, 934, 935, 936, 937, 938, 939, 940],
  "askQtys": [49000, 51000, 53000, 55000, 57000, 59000, 61000, 63000, 65000, 67000]
}

タグ: Level-2行情 株式市場API リアルタイム約定 注文ブック 10段階板情報

6月13日 00:01 投稿