EMT API  ver: 2.6.2
emt_quote_struct.h
浏览该文件的文档.
1 #pragma once
7 
8 #ifndef __EMT_MARKETDATA_H__
9 #define __EMT_MARKETDATA_H__ extern "C" _declspec(dllimport)
10 
11 #include "emt_api_data_type.h"
12 #include <inttypes.h>
13 
14 #pragma pack(1) // 内存以1字节为单位对齐
15 
16 #define MAX_LEVEL_NUM 10
17 #define MAX_LEVEL_ORDERS_NUM 50
18 #define EMT_ERR_MSG_LEN 124
19 
22 {
28 
30 typedef struct _EMTRspInfoStruct
31 {
33  int32_t error_id;
37 
39 typedef struct _EMTIndexDataStruct
40 {
46  int64_t data_time;
50  double open_price;
52  double last_price;
54  double high_price;
56  double low_price;
58  int64_t qty;
60  double turnover;
61 
63 
66 {
68  double iopv;
70  int32_t etf_buy_count;
72  int32_t etf_sell_count;
74  double etf_buy_qty;
76  double etf_buy_money;
78  double etf_sell_qty;
82  double pre_iopv;
84 
85 
88 {
96 
99 {
107 
110 {
114  int64_t auction_qty;
117 
118  // 期权数据
126  double settl_price;
128 
130 typedef struct _EMTMarketDataStruct
131 {
136 
137  // 价格
139  double last_price;
143  double open_price;
145  double high_price;
147  double low_price;
149  double close_price;
150 
151  // 涨跌停
157  int64_t data_time;
158 
159  // 量额数据
161  int64_t qty;
163  double turnover;
165  double avg_price;
166 
167  // 买卖盘
169  double bid[10];
171  double ask[10];
173  int64_t bid_qty[10];
175  int64_t ask_qty[10];
176 
178  int64_t trades_count;
180  char ticker_status[8];
181 
183  int64_t total_bid_qty;
185  int64_t total_ask_qty;
187  double ma_bid_price;
189  double ma_ask_price;
190 
212  int32_t num_bid_orders;
214  int32_t num_ask_orders;
216  union {
225  };
228 
230 
232 typedef struct _EMTTickByTickEntrust
233 {
235  int32_t channel_no;
237  char side;
239  char ord_type;
241  char __filler[2];
243  int64_t seq;
245  double price;
247  int64_t qty;
249 
251 typedef struct _EMTTickByTickTrade
252 {
254  int32_t channel_no;
258  char __filler[3];
260  int64_t seq;
262  int64_t bid_no;
264  int64_t ask_no;
266  double price;
268  int64_t qty;
270  double money;
271 
273 
275 typedef struct _EMTTickByTickStruct
276 {
278  int64_t data_time;
280  int64_t seq;
287 
289  union {
292  };
293 
295 
297 typedef struct _EMTQuoteStaticInfo {
313  double price_tick;
315  int32_t buy_qty_unit;
317  int32_t sell_qty_unit;
319 
321 typedef struct _EMTQuoteFullInfo {
335  bool is_VIE;
337  bool is_noprofit;
349  double price_tick;
355  int32_t bid_qty_unit;
361  int32_t ask_qty_unit;
375  uint64_t unknown[4];
377 
379 typedef struct _EMTOrderBookStruct {
384 
386  double last_price;
388  int64_t qty;
390  double turnover;
392  int64_t trades_count;
393 
394  // 买卖盘
396  double bid[10];
398  double ask[10];
400  int64_t bid_qty[10];
402  int64_t ask_qty[10];
404  int64_t data_time;
406 
408 typedef struct _EMTMinuteInfo {
416  int64_t data_time;
418  double last_price;
420  int64_t volume_trade;
422  double value_trade;
424  double avg_price;
426 
428 typedef struct _EMTTickerPriceInfo
429 {
435  double last_price;
437 
438 #pragma pack() // 恢复默认内存对齐方式
439 
440 #endif // !__EMT_MARKETDATA_H__
定义兼容数据基本类型
EMT_TBT_TYPE
EMT_TBT_TYPE是一个逐笔回报类型
Definition: emt_api_data_type.h:415
EMT_SECURITY_TYPE
EMT_SECURITY_TYPE是一个证券详细分类枚举类型
Definition: emt_api_data_type.h:578
EMT_TICKER_TYPE
EMT_TICKER_TYPE证券类型
Definition: emt_api_data_type.h:288
EMT_EXCHANGE_TYPE
EMT_EXCHANGE_TYPE是交易所类型,行情里使用
Definition: emt_api_data_type.h:85
EMT_QUALIFICATION_TYPE
EMT_QUALIFICATION_TYPE是一个证券适当性枚举类型
Definition: emt_api_data_type.h:568
#define EMT_TICKER_NAME_LEN
存放证券名称的字符串长度
Definition: emt_api_data_type.h:24
#define EMT_TICKER_LEN
存放证券代码的字符串长度
Definition: emt_api_data_type.h:22
struct _EMTRspInfoStruct EMTRspInfoStruct
响应信息
struct _EMTQuoteFullInfo EMTQuoteFullInfo
股票行情全量静态信息
struct _EMTMarketDataStruct EMTMarketDataStruct
快照行情结构体
struct _EMTTickByTickStruct EMTTickByTickStruct
逐笔数据信息
struct _EMTQuoteStaticInfo EMTQuoteStaticInfo
股票行情静态信息
struct _EMTTickerPriceInfo EMTTickerPriceInfo
最新价
struct _EMTIndexDataStruct EMTIndexDataStruct
指数行情结构体
struct _EMTOrderBookStruct EMTOrderBookStruct
订单簿
#define EMT_ERR_MSG_LEN
Definition: emt_quote_struct.h:18
struct _EMTMinuteInfo EMTMinuteInfo
现货(股票、基金、债券)和期权分时快照
struct _EMTSpecificTickerStruct EMTSpecificTickerStruct
指定的合约
struct _EMTMarketDataFundExData EMTMarketDataFundExData
基金额外数据结构体
struct _EMTMarketDataOptionExData EMTMarketDataOptionExData
期权额外数据
struct _EMTTickByTickTrade EMTTickByTickTrade
逐笔成交数据
struct _EMTMarketDataWarrantExData EMTMarketDataWarrantExData
权证额外数据
struct _EMTMarketDataBondExData EMTMarketDataBondExData
债券额外数据结构体
struct _EMTTickByTickEntrust EMTTickByTickEntrust
逐笔委托数据(当前仅适用深交所)
指数行情结构体
Definition: emt_quote_struct.h:40
int64_t qty
数量,为总成交量(单位股,与交易所一致)
Definition: emt_quote_struct.h:58
double high_price
最高价
Definition: emt_quote_struct.h:54
char ticker[EMT_TICKER_LEN]
合约代码(不包含交易所信息),不带空格,以"\0"结尾
Definition: emt_quote_struct.h:44
double low_price
最低价
Definition: emt_quote_struct.h:56
EMT_EXCHANGE_TYPE exchange_id
交易所代码
Definition: emt_quote_struct.h:42
double last_price
最新价
Definition: emt_quote_struct.h:52
double open_price
今日开盘价
Definition: emt_quote_struct.h:50
int64_t data_time
行情时间,格式为YYYYMMDDHHMMSSssss
Definition: emt_quote_struct.h:46
double turnover
成交金额,为总成交金额(单位元,与交易所一致)
Definition: emt_quote_struct.h:60
double pre_close_price
昨日收盘价
Definition: emt_quote_struct.h:48
债券额外数据结构体
Definition: emt_quote_struct.h:88
double ma_bond_ask_price
债券加权平均委卖价格(SH)
Definition: emt_quote_struct.h:92
double ma_bond_bid_price
债券加权平均委买价格(SH)
Definition: emt_quote_struct.h:90
double yield_to_maturity
债券到期收益率(SH)
Definition: emt_quote_struct.h:94
基金额外数据结构体
Definition: emt_quote_struct.h:66
double etf_sell_money
ETF赎回金额(SH)
Definition: emt_quote_struct.h:80
int32_t etf_sell_count
ETF赎回笔数(SH)
Definition: emt_quote_struct.h:72
double pre_iopv
基金T-1日净值(SZ)
Definition: emt_quote_struct.h:82
double etf_buy_money
ETF申购金额(SH)
Definition: emt_quote_struct.h:76
double iopv
基金实时参考净值(SH,SZ)
Definition: emt_quote_struct.h:68
double etf_buy_qty
ETF申购数量(SH)
Definition: emt_quote_struct.h:74
int32_t etf_buy_count
ETF申购笔数(SH)
Definition: emt_quote_struct.h:70
double etf_sell_qty
ETF赎回数量(SH)
Definition: emt_quote_struct.h:78
期权额外数据
Definition: emt_quote_struct.h:110
int64_t last_enquiry_time
最近询价时间(SH)
Definition: emt_quote_struct.h:116
int64_t auction_qty
波段性中断集合竞价虚拟匹配量(SH)
Definition: emt_quote_struct.h:114
int64_t total_long_positon
持仓量(张)(目前未填写)
Definition: emt_quote_struct.h:122
double settl_price
今日结算价(目前未填写)
Definition: emt_quote_struct.h:126
int64_t pre_total_long_positon
昨日持仓量(张)(目前未填写)
Definition: emt_quote_struct.h:120
double auction_price
波段性中断参考价(SH)
Definition: emt_quote_struct.h:112
double pre_settl_price
昨日结算价(目前未填写)
Definition: emt_quote_struct.h:124
快照行情结构体
Definition: emt_quote_struct.h:131
double upper_limit_price
涨停价(SZ)
Definition: emt_quote_struct.h:153
int64_t qty
数量,为总成交量(单位股,与交易所一致)
Definition: emt_quote_struct.h:161
double lower_limit_price
跌停价(SZ)
Definition: emt_quote_struct.h:155
EMTMarketDataWarrantExData warrant
权证额外数据
Definition: emt_quote_struct.h:222
int64_t total_bid_qty
委托买入总量(SH,SZ)
Definition: emt_quote_struct.h:183
int64_t total_buy_count
买入总笔数(SH)
Definition: emt_quote_struct.h:204
char ticker_status[8]
当前交易状态说明(SH)
Definition: emt_quote_struct.h:180
double high_price
最高价
Definition: emt_quote_struct.h:145
int32_t duration_after_buy
买入委托成交最大等待时间(SH)
Definition: emt_quote_struct.h:208
int32_t num_bid_orders
买方委托价位数(SH)
Definition: emt_quote_struct.h:212
EMTMarketDataBondExData bond
债券额外数据
Definition: emt_quote_struct.h:218
int32_t num_ask_orders
卖方委托价位数(SH)
Definition: emt_quote_struct.h:214
double avg_price
当日均价=(turnover/qty)
Definition: emt_quote_struct.h:165
char ticker[EMT_TICKER_LEN]
合约代码(不包含交易所信息),不带空格。以"\0"结尾
Definition: emt_quote_struct.h:135
EMTMarketDataFundExData fund
基金额外数据
Definition: emt_quote_struct.h:220
double low_price
最低价
Definition: emt_quote_struct.h:147
double cancel_buy_money
买入撤单金额(SH)
Definition: emt_quote_struct.h:200
EMTMarketDataOptionExData opt
期权额外数据
Definition: emt_quote_struct.h:224
double ask[10]
十档申卖价
Definition: emt_quote_struct.h:171
int32_t cancel_buy_count
买入撤单笔数(SH)
Definition: emt_quote_struct.h:192
double cancel_sell_qty
卖出撤单数量(SH)
Definition: emt_quote_struct.h:198
int64_t trades_count
成交笔数
Definition: emt_quote_struct.h:178
double ma_bid_price
加权平均委买价格(SH,SZ)
Definition: emt_quote_struct.h:187
EMT_EXCHANGE_TYPE exchange_id
交易所代码
Definition: emt_quote_struct.h:133
double bid[10]
十档申买价
Definition: emt_quote_struct.h:169
double last_price
最新价
Definition: emt_quote_struct.h:139
int64_t bid_qty[10]
十档申买量
Definition: emt_quote_struct.h:173
double ma_ask_price
加权平均委卖价格(SH,SZ)
Definition: emt_quote_struct.h:189
int64_t total_ask_qty
委托卖出总量(SH,SZ)
Definition: emt_quote_struct.h:185
double open_price
今开盘价
Definition: emt_quote_struct.h:143
int32_t duration_after_sell
卖出委托成交最大等待时间(SH)
Definition: emt_quote_struct.h:210
int64_t data_time
行情时间,格式为YYYYMMDDHHMMSSssss
Definition: emt_quote_struct.h:157
double cancel_sell_money
卖出撤单金额(SH)
Definition: emt_quote_struct.h:202
int32_t cancel_sell_count
卖出撤单笔数(SH)
Definition: emt_quote_struct.h:194
EMT_TICKER_TYPE data_type
证券类别;1:股票,基金,债券,权证,质押式回购;2:期权;决定了union是哪种数据类型
Definition: emt_quote_struct.h:227
int64_t ask_qty[10]
十档申卖量
Definition: emt_quote_struct.h:175
double cancel_buy_qty
买入撤单数量(SH)
Definition: emt_quote_struct.h:196
int64_t total_sell_count
卖出总笔数(SH)
Definition: emt_quote_struct.h:206
double turnover
成交金额,为总成交金额(单位元,与交易所一致)
Definition: emt_quote_struct.h:163
double pre_close_price
昨日收盘价
Definition: emt_quote_struct.h:141
double close_price
今收盘价(SH)
Definition: emt_quote_struct.h:149
权证额外数据
Definition: emt_quote_struct.h:99
double total_warrant_exec_qty
权证执行的总数量(SH)
Definition: emt_quote_struct.h:101
double warrant_upper_price
权证涨停价格(元)(SH)
Definition: emt_quote_struct.h:105
double warrant_lower_price
权证跌停价格(元)(SH)
Definition: emt_quote_struct.h:103
现货(股票、基金、债券)和期权分时快照
Definition: emt_quote_struct.h:408
double avg_price
均价,单位:元
Definition: emt_quote_struct.h:424
EMT_EXCHANGE_TYPE exchange_type
交易所代码
Definition: emt_quote_struct.h:410
EMT_TICKER_TYPE ticker_type
合约类型
Definition: emt_quote_struct.h:412
char ticker[EMT_TICKER_LEN]
合约代码(不包含交易所信息),不带空格,以'\0'结尾
Definition: emt_quote_struct.h:414
int64_t volume_trade
一分钟内成交总量,单位:股
Definition: emt_quote_struct.h:420
double last_price
最新价
Definition: emt_quote_struct.h:418
int64_t data_time
时间,格式为YYYYMMDDHHMMSSsss
Definition: emt_quote_struct.h:416
double value_trade
一分钟内成交总金额,单位:元
Definition: emt_quote_struct.h:422
订单簿
Definition: emt_quote_struct.h:379
int64_t qty
数量,为总成交量
Definition: emt_quote_struct.h:388
char ticker[EMT_TICKER_LEN]
合约代码(不包含交易所信息),不带空格,以'\0'结尾
Definition: emt_quote_struct.h:383
double ask[10]
十档申卖价
Definition: emt_quote_struct.h:398
int64_t trades_count
成交笔数
Definition: emt_quote_struct.h:392
EMT_EXCHANGE_TYPE exchange_id
交易所代码
Definition: emt_quote_struct.h:381
double bid[10]
十档申买价
Definition: emt_quote_struct.h:396
double last_price
最新价
Definition: emt_quote_struct.h:386
int64_t bid_qty[10]
十档申买量
Definition: emt_quote_struct.h:400
int64_t data_time
时间类
Definition: emt_quote_struct.h:404
int64_t ask_qty[10]
十档申卖量
Definition: emt_quote_struct.h:402
double turnover
成交金额,为总成交金额
Definition: emt_quote_struct.h:390
股票行情全量静态信息
Definition: emt_quote_struct.h:321
double upper_limit_price
涨停价(仅在有涨跌幅限制时有效)
Definition: emt_quote_struct.h:343
int32_t market_ask_qty_unit
市价卖数量单位
Definition: emt_quote_struct.h:373
EMT_SECURITY_TYPE security_type
合约详细类型
Definition: emt_quote_struct.h:329
double lower_limit_price
跌停价(仅在有涨跌幅限制时有效)
Definition: emt_quote_struct.h:345
int32_t ask_qty_lower_limit
限价卖委托数量下限
Definition: emt_quote_struct.h:359
EMT_QUALIFICATION_TYPE ticker_qualification_class
合约适当性类别
Definition: emt_quote_struct.h:331
bool is_have_price_limit
是否有涨跌幅限制(注:不提供具体幅度,可通过涨跌停价和昨收价来计算幅度)
Definition: emt_quote_struct.h:341
int32_t market_bid_qty_unit
市价买数量单位
Definition: emt_quote_struct.h:367
double price_tick
价格最小变动价位
Definition: emt_quote_struct.h:349
char ticker[EMT_TICKER_LEN]
证券代码
Definition: emt_quote_struct.h:325
int32_t bid_qty_upper_limit
限价买委托数量上限
Definition: emt_quote_struct.h:351
int32_t bid_qty_lower_limit
限价买委托数量下限
Definition: emt_quote_struct.h:353
bool is_registration
是否注册制(仅适用创业板股票,创新企业股票及存托凭证)
Definition: emt_quote_struct.h:333
int32_t market_ask_qty_upper_limit
市价卖委托数量上限
Definition: emt_quote_struct.h:369
int32_t market_bid_qty_upper_limit
市价买委托数量上限
Definition: emt_quote_struct.h:363
int32_t ask_qty_unit
限价卖数量单位
Definition: emt_quote_struct.h:361
bool is_VIE
是否具有协议控制架构(仅适用创业板股票,创新企业股票及存托凭证)
Definition: emt_quote_struct.h:335
EMT_EXCHANGE_TYPE exchange_id
交易所代码
Definition: emt_quote_struct.h:323
int32_t bid_qty_unit
限价买数量单位
Definition: emt_quote_struct.h:355
bool is_noprofit
是否尚未盈利(仅适用创业板股票,创新企业股票及存托凭证)
Definition: emt_quote_struct.h:337
bool is_weighted_voting_rights
是否存在投票权差异(仅适用创业板股票,创新企业股票及存托凭证)
Definition: emt_quote_struct.h:339
int32_t market_ask_qty_lower_limit
市价卖委托数量下限
Definition: emt_quote_struct.h:371
char ticker_name[EMT_TICKER_NAME_LEN]
证券名称
Definition: emt_quote_struct.h:327
uint64_t unknown[4]
保留字段
Definition: emt_quote_struct.h:375
double pre_close_price
昨收价
Definition: emt_quote_struct.h:347
int32_t ask_qty_upper_limit
限价卖委托数量上限
Definition: emt_quote_struct.h:357
int32_t market_bid_qty_lower_limit
市价买委托数量下限
Definition: emt_quote_struct.h:365
股票行情静态信息
Definition: emt_quote_struct.h:297
double upper_limit_price
涨停板价
Definition: emt_quote_struct.h:309
double lower_limit_price
跌停板价
Definition: emt_quote_struct.h:311
EMT_TICKER_TYPE ticker_type
合约类型
Definition: emt_quote_struct.h:305
double price_tick
最小变动价位
Definition: emt_quote_struct.h:313
char ticker[EMT_TICKER_LEN]
合约代码(不包含交易所信息),不带空格,以'\0'结尾
Definition: emt_quote_struct.h:301
EMT_EXCHANGE_TYPE exchange_id
交易所代码
Definition: emt_quote_struct.h:299
char ticker_name[EMT_TICKER_NAME_LEN]
合约名称
Definition: emt_quote_struct.h:303
int32_t sell_qty_unit
合约最小交易量(卖)
Definition: emt_quote_struct.h:317
int32_t buy_qty_unit
合约最小交易量(买)
Definition: emt_quote_struct.h:315
double pre_close_price
昨收盘
Definition: emt_quote_struct.h:307
响应信息
Definition: emt_quote_struct.h:31
int32_t error_id
错误代码
Definition: emt_quote_struct.h:33
char error_msg[EMT_ERR_MSG_LEN]
错误信息
Definition: emt_quote_struct.h:35
指定的合约
Definition: emt_quote_struct.h:22
char ticker[EMT_TICKER_LEN]
合约代码(不包含交易所信息)例如"600000",不带空格,以'\0'结尾
Definition: emt_quote_struct.h:26
EMT_EXCHANGE_TYPE exchange_id
交易所代码
Definition: emt_quote_struct.h:24
逐笔委托数据(当前仅适用深交所)
Definition: emt_quote_struct.h:233
int64_t qty
委托数量
Definition: emt_quote_struct.h:247
int32_t channel_no
频道代码
Definition: emt_quote_struct.h:235
double price
委托价格
Definition: emt_quote_struct.h:245
char __filler[2]
填充字段
Definition: emt_quote_struct.h:241
char side
买卖方向:1":买;"2":卖;"G":借入;"F":出借
Definition: emt_quote_struct.h:237
char ord_type
订单类别:"1":市价;"2":限价;"U":本方最优
Definition: emt_quote_struct.h:239
int64_t seq
委托序号(在同一个channel_no内唯一,从1开始连续)
Definition: emt_quote_struct.h:243
逐笔数据信息
Definition: emt_quote_struct.h:276
EMT_TBT_TYPE type
逐笔类型;"1":逐笔委托;"2":逐笔成交
Definition: emt_quote_struct.h:286
char ticker[EMT_TICKER_LEN]
合约代码(不包含交易所信息),不带空格,以"\0"结尾
Definition: emt_quote_struct.h:284
EMTTickByTickEntrust entrust
Definition: emt_quote_struct.h:290
EMTTickByTickTrade trade
Definition: emt_quote_struct.h:291
EMT_EXCHANGE_TYPE exchange_id
交易所代码
Definition: emt_quote_struct.h:282
int64_t data_time
委托时间or成交时间
Definition: emt_quote_struct.h:278
int64_t seq
消息记录号,从1开始
Definition: emt_quote_struct.h:280
逐笔成交数据
Definition: emt_quote_struct.h:252
int64_t bid_no
买方订单号(SH);买方委托索引(SZ)
Definition: emt_quote_struct.h:262
int64_t qty
成交量(股票:股;债券:手)
Definition: emt_quote_struct.h:268
int32_t channel_no
成交通道(SH);频道代码(SZ)
Definition: emt_quote_struct.h:254
int64_t ask_no
卖方订单号(SH);卖方委托索引(SZ)
Definition: emt_quote_struct.h:264
double money
成交金额(元;仅适用于上交所;等于成交价格*成交数量)
Definition: emt_quote_struct.h:270
char __filler[3]
填充字段
Definition: emt_quote_struct.h:258
double price
成交价格(元)
Definition: emt_quote_struct.h:266
char trade_flag
SH:内外盘标识('B':主动买; 'S':主动卖; 'N':未知);SZ:成交类别('4':Cancelled,表示已撤销;'F':Trade,表示已成交)
Definition: emt_quote_struct.h:256
int64_t seq
成交序号(SH);消息记录号(SZ)(在同一个channel_no内唯一,从1开始连续)
Definition: emt_quote_struct.h:260
最新价
Definition: emt_quote_struct.h:429
EMT_EXCHANGE_TYPE exchange_type
交易所代码
Definition: emt_quote_struct.h:431
char ticker[EMT_TICKER_LEN]
合约代码(不包含交易所信息),不带空格,以'\0'结尾
Definition: emt_quote_struct.h:433
double last_price
最新价
Definition: emt_quote_struct.h:435