level2_sh_new 上海新level2快照数据


接口:level2_sh_new
描述:level2新接口,包含上海数据。
限量:单次最大30000

已入库数据时间

开始时间 结束时间
20220101 上个交易日

输入参数

名称 类型 必选 描述
code str N 股票代码 601901.SH
tradetime str N 2020-01-02 09:30:00.000 or 2020-01-02 09:30:00 or 2020-01-02
start_time str N 2020-01-02 09:30:00.000 or 2020-01-02 09:30:00 or 2020-01-02
end_time str N 2020-01-02 09:30:00.000 or 2020-01-02 09:30:00 or 2020-01-02

输出参数

名称 类型 默认显示 描述
code str Y 证券代码
tradetime str Y 交易时间
preclosepx float Y 昨收盘价或昨收盘指数
openpx float Y 开盘价或开盘指数
highpx float Y 最高价或最高指数
lowpx float Y 最低价或最低指数
lastpx float Y 限价或当前指数
totalvolumetrade int Y 成交量
totalvaluetrade float Y 成交金额(元)
instrumentstatus str Y 当前品种交易状态
bidprice1 float Y 申买一价
bidprice2 float Y 申买二价
bidprice3 float Y 申买三价
bidprice4 float Y 申买四价
bidprice5 float Y 申买五价
bidprice6 float Y 申买六价
bidprice7 float Y 申买七价
bidprice8 float Y 申买八价
bidprice9 float Y 申买九价
bidprice10 float Y 申买十价
bidorderqty1 int Y 申买一量
bidorderqty2 int Y 申买二量
bidorderqty3 int Y 申买三量
bidorderqty4 int Y 申买四量
bidorderqty5 int Y 申买五量
bidorderqty6 int Y 申买六量
bidorderqty7 int Y 申买七量
bidorderqty8 int Y 申买八量
bidorderqty9 int Y 申买九量
bidorderqty10 int Y 申买十量
bidnumorder1 int Y 申买一实际总委托笔数
bidnumorder2 int Y 申买二实际总委托笔数
bidnumorder3 int Y 申买三实际总委托笔数
bidnumorder4 int Y 申买四实际总委托笔数
bidnumorder5 int Y 申买五实际总委托笔数
bidnumorder6 int Y 申买六实际总委托笔数
bidnumorder7 int Y 申买七实际总委托笔数
bidnumorder8 int Y 申买八实际总委托笔数
bidnumorder9 int Y 申买九实际总委托笔数
bidnumorder10 int Y 申买十实际总委托笔数
offerprice1 float Y 申卖一价
offerprice2 float Y 申卖二价
offerprice3 float Y 申卖三价
offerprice4 float Y 申卖四价
offerprice5 float Y 申卖五价
offerprice6 float Y 申卖六价
offerprice7 float Y 申卖七价
offerprice8 float Y 申卖八价
offerprice9 float Y 申卖九价
offerprice10 float Y 申卖十价
offerorderqty1 int Y 申卖一量
offerorderqty2 int Y 申卖二量
offerorderqty3 int Y 申卖三量
offerorderqty4 int Y 申卖四量
offerorderqty5 int Y 申卖五量
offerorderqty6 int Y 申卖六量
offerorderqty7 int Y 申卖七量
offerorderqty8 int Y 申卖八量
offerorderqty9 int Y 申卖九量
offerorderqty10 int Y 申卖十量
offernumorder1 int Y 申卖一实际委托笔数
offernumorder2 int Y 申卖二实际委托笔数
offernumorder3 int Y 申卖三实际委托笔数
offernumorder4 int Y 申卖四实际委托笔数
offernumorder5 int Y 申卖五实际委托笔数
offernumorder6 int Y 申卖六实际委托笔数
offernumorder7 int Y 申卖七实际委托笔数
offernumorder8 int Y 申卖八实际委托笔数
offernumorder9 int Y 申卖九实际委托笔数
offernumorder10 int Y 申卖十实际委托笔数
numtrades int Y 成交笔数
iopv float Y ETF净值估值
totalbidqty int Y 委托买入总量
totalofferqty int Y 委托卖出总量
weightedavgbidpx float Y 加权平均委买价格(债券共用)(元)
weightedavgofferpx float Y 加权平均委卖价格(债券共用)(元)
totalbidnumber int Y 买入总笔数
totaloffernumber int Y 卖出总笔数
bidtrademaxduration int Y 买入委托成交最大等待时间
offertrademaxduration int Y 卖出委托成交最大等待时间
numbidorders int Y 买方委托价位数
numofferorders int Y 卖方委托价位数
withdrawbuynumber int Y 买入撤单笔数
withdrawbuyamount int Y 买入撤单数量
withdrawbuymoney float Y 买入撤单金额
withdrawsellnumber int Y 卖出撤单笔数
withdrawsellamount int Y 卖出撤单数量
withdrawsellmoney float Y 卖出撤单金额
etfbuynumber int Y ETF申购笔数
etfbuyamount int Y ETF申购数量
etfsellmoney float Y ETF申购金额
etfsellnumber int Y ETF赎回笔数
etfsellamount int Y ETF赎回数量
etfbuymoney float Y ETF赎回金额

L2快照新接口字段调整说明

类型 增加字段 删除字段 变更字段
沪市L2快照 SecurityID(证券代码) SendingTime(发送时间),MsgSeqNum(消息序列),ImageStatus(快照类型),ClosePx(收盘价),AveragePx(均价或指数均值),YieldToMaturity(债券到期收益率),TotalWarrantExecQty(权证执行的总数量),WarLowerPx(债券质押式回购品种加权平均值),WarUpperPx(权证涨停价),TradingPhaseCode(当前产品状态) QuotTime(行情时间)→DateTime(日期时间),申买十价由1个字段变为10个字段,申买十量由1个字段变为10个字段,申买十实际总委托笔数由1个字段变为10个字段,申买一前50笔订单由1个字段变为50个字段,申卖十价由1个字段变为10个字段,申卖十量由1个字段变为10个字段,申卖十实际总委托笔数由1个字段变为10个字段,申卖一前50笔订单由1个字段变为50个字段。

示例

安装Python包

pip install dcube

导入datacube

import dcube as dc

用token初始化pro接口

pro = dc.pro_api('your token')

数据调取

df = pro.query('level2_sh_new', code='601901.SH',tradetime='2021-07-06',fields='code,tradetime,preclosepx,openpx,highpx,lowpx')

或者

df = pro.level2_sh_new(code='601901.SH',tradetime='2021-07-06')
置顶