Level2 行情说明文档

DEMO 地址:https://stockapi.com.cn/

1. 交易所说明

交易所 数据类型
上交所 十档行情快照(Level-2)、委托队列(Level-2)、逐笔委托(Level-2)、逐笔成交(Level-2)
深交所 十档行情快照(Level-2)、委托队列(Level-2)、逐笔委托(Level-2)、逐笔成交(Level-2)
数据品种 ETF、A 股、可转债

2. 消息类型

消息类型 说明
TickRecord 逐笔成交
OrderRecord 逐笔委托
OrderQueueRecord 委托队列
StockQuoteRecord 股票十档行情

2.1 TickRecord(逐笔成交)

字段名 类型 备注
stock_exchange uint32 证券市场,1-SH,2-SZ
stock_code string 证券代码
created_at int64 成交日期时间戳(毫秒)
code string 成交编号
price uint32 成交单价
volume uint64 成交数量
amount uint64 成交金额
tx_dir uint32 交易方向:0-未知,1-买方成交,2-卖方成交
tx_kind uint32 交易类型:0-成交,1-撤单
buy_order_seq string 买方委托序号
sell_order_seq string 卖方委托序号

返回示例:

{
  "stock_exchange": 1,
  "stock_code": "600000",
  "created_at": 1623456789012,
  "code": "123456",
  "price": 1000,
  "volume": 100,
  "amount": 100000,
  "tx_dir": 1,
  "tx_kind": 0,
  "buy_order_seq": "B12345",
  "sell_order_seq": "S67890"
}

2.2 OrderRecord(逐笔委托)

字段名 类型 备注
stock_exchange uint32 证券市场,1-SH,2-SZ
stock_code string 证券代码
created_at int64 委托日期时间戳(毫秒)
code string 委托编号
price uint32 委托单价
volume uint64 委托数量
amount uint64 成交金额
tx_dir uint32 交易方向:0-未知,1-买入,2-卖出
tx_kind uint32 交易类型:1-市价,2-限价,3-本方优先,10-撤单,11-暂不清楚(基金/债券有此值)

返回示例:

{
  "stock_exchange": 1,
  "stock_code": "600000",
  "created_at": 1623456789012,
  "code": "123456",
  "price": 1000,
  "volume": 100,
  "amount": 100000,
  "tx_dir": 1,
  "tx_kind": 2
}

2.3 OrderQueueRecord(委托队列)

字段名 类型 备注
stock_exchange uint32 证券市场,1-SH,2-SZ
stock_code string 证券代码
created_at int64 委托日期时间戳(毫秒)
bid1_price uint32 买1价
bid1_quantity uint32 买1笔数
ask1_price uint32 卖1价
ask1_quantity uint32 卖1笔数
bid_volume_detail repeated uint32 委托买入数量明细
ask_volume_detail repeated uint32 委托卖出数量明细

返回示例:

{
  "stock_exchange": 1,
  "stock_code": "600000",
  "created_at": 1623456789012,
  "bid1_price": 990,
  "bid1_quantity": 100,
  "ask1_price": 1000,
  "ask1_quantity": 100,
  "bid_volume_detail": [100, 90, 80, 70, 60, 50, 40, 30, 20, 10],
  "ask_volume_detail": [100, 110, 120, 130, 140, 150, 160, 170, 180, 190]
}

2.4 StockQuoteRecord(十档行情快照)

字段名 类型 备注
stock_exchange uint32 证券市场,见数据字典
stock_code string 证券代码
created_at int64 快照日期时间戳(毫秒)
status uint32 状态:0-开盘前,1-开盘集合竞价,2-集合竞价至连续竞价,3-连续竞价,4-中午休市,5-收盘集合竞价,6-闭市
prev_close_price uint32 前收盘价
open_price uint32 开盘价
latest_price uint32 最新价
high_price uint32 最高价
low_price uint32 最低价
limit_up_price uint32 涨停价
limit_down_price uint32 跌停价
order_quantity uint32 成交笔数
volume uint64 成交数量
amount uint64 成交金额
bid_volume uint64 委托买入数量
bid_price uint32 委托买入加权平均价
ask_volume uint64 委托卖出数量
ask_price uint32 委托卖出加权平均价
bid_price_detail repeated uint32 委托买入价格明细(十档)
bid_volume_detail repeated uint32 委托买入数量明细(十档)
ask_price_detail repeated uint32 委托卖出价格明细(十档)
ask_volume_detail repeated uint32 委托卖出数量明细(十档)

返回示例:

{
  "stock_exchange": 1,
  "stock_code": "600000",
  "created_at": 1623456789012,
  "status": 3,
  "prev_close_price": 990,
  "open_price": 995,
  "latest_price": 1000,
  "high_price": 1010,
  "low_price": 990,
  "limit_up_price": 1099,
  "limit_down_price": 891,
  "order_quantity": 1000,
  "volume": 1000000,
  "amount": 1000000000,
  "bid_volume": 500000,
  "bid_price": 999,
  "ask_volume": 500000,
  "ask_price": 1001,
  "bid_price_detail": [999, 998, 997, 996, 995, 994, 993, 992, 991, 990],
  "bid_volume_detail": [100000, 90000, 80000, 70000, 60000, 50000, 40000, 30000, 20000, 10000],
  "ask_price_detail": [1001, 1002, 1003, 1004, 1005, 1006, 1007, 1008, 1009, 1010],
  "ask_volume_detail": [100000, 110000, 120000, 130000, 140000, 150000, 160000, 170000, 180000, 190000]
}
Logo

专业量化交易与投资者大本营

更多推荐