GET /ticks/{ticks_symbol}
传参:
| 字段名 | 类型 | 是否必传 | 字段说明 |
|---|---|---|---|
| ticks_symbol | str | 否 |
K线标识,格式:{symbol}_{data_length} symbol (str): 指定合约代码. data_length (int): 需要获取的序列长度。每个序列最大支持请求 8000 个数据 不传默认获取所有隐性订阅过的Ticks,支持多个,多个用英文逗号分割 示例:SHFE.rb2210_5 |
响应参数(参考TqSdk官方文档: https://doc.shinnytech.com/tqsdk/latest/reference/tqsdk.objs.html#tqsdk.objs.Tick):
| 字段名 | 类型 | 字段说明 |
|---|---|---|
| datetime | int | tick从交易所发出的时间(按北京时间),自unix epoch(1970-01-01 00:00:00 GMT)以来的纳秒数 |
| last_price | float | 最新价 |
| average | float | 当日均价 |
| highest | float | 当日最高价 |
| lowest | float | 当日最低价 |
| ask_price1 | float | 卖一价 |
| ask_volume1 | int | 卖一量 |
| bid_price1 | float | 买一价 |
| bid_volume1 | int | 买一量 |
| ask_price2 | float | 卖二价 |
| ask_volume2 | int | 卖二量 |
| bid_price2 | float | 买二价 |
| bid_volume2 | int | 买二量 |
| ask_price3 | float | 卖三价 |
| ask_volume3 | int | 卖三量 |
| bid_price3 | float | 买三价 |
| bid_volume3 | int | 买三量 |
| ask_price4 | float | 卖四价 |
| ask_volume4 | int | 卖四量 |
| bid_price4 | float | 买四价 |
| bid_volume4 | int | 买四量 |
| ask_price5 | float | 卖五价 |
| ask_volume5 | int | 卖五量 |
| bid_price5 | float | 买五价 |
| bid_volume5 | int | 买五量 |
| volume | int | 当日成交量 |
| amount | int | 成交额 |
| open_interest | int | 持仓量 |
请求示例:
curl http://127.0.0.1:8888/ticks/SHFE.rb2210_5
响应示例:
{
"code": 10000,
"data": {
"SHFE.rb2210_5": [{
"datetime": 1.6638587375e+18,
"id": 8169903.0,
"last_price": 3947.0,
"average": 3952.52738,
"highest": 3965.0,
"lowest": 3938.0,
"ask_price1": 3948.0,
"ask_volume1": 50.0,
"bid_price1": 3947.0,
"bid_volume1": 13.0,
"ask_price2": 3949.0,
"ask_volume2": 24.0,
"bid_price2": 3946.0,
"bid_volume2": 91.0,
"ask_price3": 3950.0,
"ask_volume3": 33.0,
"bid_price3": 3945.0,
"bid_volume3": 54.0,
"ask_price4": 3951.0,
"ask_volume4": 79.0,
"bid_price4": 3944.0,
"bid_volume4": 152.0,
"ask_price5": 3952.0,
"ask_volume5": 21.0,
"bid_price5": 3943.0,
"bid_volume5": 94.0,
"volume": 36012.0,
"amount": 1423384160.0,
"open_interest": 186695.0,
"symbol": "SHFE.rb2210",
"duration": 0
}, {
"datetime": 1.663858738e+18,
"id": 8169904.0,
"last_price": 3947.0,
"average": 3952.52738,
"highest": 3965.0,
"lowest": 3938.0,
"ask_price1": 3948.0,
"ask_volume1": 50.0,
"bid_price1": 3947.0,
"bid_volume1": 37.0,
"ask_price2": 3949.0,
"ask_volume2": 24.0,
"bid_price2": 3946.0,
"bid_volume2": 90.0,
"ask_price3": 3950.0,
"ask_volume3": 33.0,
"bid_price3": 3945.0,
"bid_volume3": 54.0,
"ask_price4": 3951.0,
"ask_volume4": 79.0,
"bid_price4": 3944.0,
"bid_volume4": 152.0,
"ask_price5": 3952.0,
"ask_volume5": 21.0,
"bid_price5": 3943.0,
"bid_volume5": 94.0,
"volume": 36012.0,
"amount": 1423384160.0,
"open_interest": 186695.0,
"symbol": "SHFE.rb2210",
"duration": 0
}, {
"datetime": 1.6638587385e+18,
"id": 8169905.0,
"last_price": 3947.0,
"average": 3952.52738,
"highest": 3965.0,
"lowest": 3938.0,
"ask_price1": 3948.0,
"ask_volume1": 28.0,
"bid_price1": 3947.0,
"bid_volume1": 37.0,
"ask_price2": 3949.0,
"ask_volume2": 24.0,
"bid_price2": 3946.0,
"bid_volume2": 90.0,
"ask_price3": 3950.0,
"ask_volume3": 33.0,
"bid_price3": 3945.0,
"bid_volume3": 54.0,
"ask_price4": 3951.0,
"ask_volume4": 79.0,
"bid_price4": 3944.0,
"bid_volume4": 152.0,
"ask_price5": 3952.0,
"ask_volume5": 21.0,
"bid_price5": 3943.0,
"bid_volume5": 94.0,
"volume": 36012.0,
"amount": 1423384160.0,
"open_interest": 186695.0,
"symbol": "SHFE.rb2210",
"duration": 0
}, {
"datetime": 1.663858739e+18,
"id": 8169906.0,
"last_price": 3947.0,
"average": 3952.52738,
"highest": 3965.0,
"lowest": 3938.0,
"ask_price1": 3948.0,
"ask_volume1": 28.0,
"bid_price1": 3947.0,
"bid_volume1": 37.0,
"ask_price2": 3949.0,
"ask_volume2": 25.0,
"bid_price2": 3946.0,
"bid_volume2": 90.0,
"ask_price3": 3950.0,
"ask_volume3": 33.0,
"bid_price3": 3945.0,
"bid_volume3": 54.0,
"ask_price4": 3951.0,
"ask_volume4": 79.0,
"bid_price4": 3944.0,
"bid_volume4": 152.0,
"ask_price5": 3952.0,
"ask_volume5": 21.0,
"bid_price5": 3943.0,
"bid_volume5": 94.0,
"volume": 36012.0,
"amount": 1423384160.0,
"open_interest": 186695.0,
"symbol": "SHFE.rb2210",
"duration": 0
}, {
"datetime": 1.6638587395e+18,
"id": 8169907.0,
"last_price": 3947.0,
"average": 3952.52738,
"highest": 3965.0,
"lowest": 3938.0,
"ask_price1": 3948.0,
"ask_volume1": 34.0,
"bid_price1": 3947.0,
"bid_volume1": 30.0,
"ask_price2": 3949.0,
"ask_volume2": 15.0,
"bid_price2": 3946.0,
"bid_volume2": 87.0,
"ask_price3": 3950.0,
"ask_volume3": 28.0,
"bid_price3": 3945.0,
"bid_volume3": 47.0,
"ask_price4": 3951.0,
"ask_volume4": 76.0,
"bid_price4": 3944.0,
"bid_volume4": 148.0,
"ask_price5": 3952.0,
"ask_volume5": 12.0,
"bid_price5": 3943.0,
"bid_volume5": 83.0,
"volume": 36012.0,
"amount": 1423384160.0,
"open_interest": 186695.0,
"symbol": "SHFE.rb2210",
"duration": 0
}]
},
"msg": "操作成功!"
}