Libannhoo_md_sdk
1.6.1
for index, tick(entrust and trade), and snapshot with solar flare
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Pages
ah_md_common.h
Go to the documentation of this file.
1
7
#ifndef __AH_MD_COMMON_H__
8
#define __AH_MD_COMMON_H__
9
10
#include <arpa/inet.h>
11
#include <endian.h>
12
#include <stdint.h>
13
#include <stdio.h>
14
#include <string.h>
15
16
#include <atomic>
17
22
namespace
annhoo {
23
#pragma pack(push)
24
#pragma pack(1)
25
30
struct
AHDataHeader
{
31
uint16_t
MsgType
;
32
char
ExchangeID
[2];
33
};
34
40
struct
AHIndex
{
41
AHDataHeader
header
;
42
char
MDStreamID
[4];
43
union
{
44
int64_t
OrigTime
;
45
int64_t
TradeTime
;
46
};
47
48
uint16_t
ChannelNo
;
49
char
TradingPhaseCode
[2];
51
char
SecurityID
[8];
52
int64_t
LastIndex
;
53
int64_t
PreCloseIndex
;
54
int64_t
OpenIndex
;
55
int64_t
HighIndex
;
56
int64_t
LowIndex
;
57
int64_t
CloseIndex
;
58
int64_t
TotalVolumeTrade
;
59
int64_t
TotalValueTrade
;
60
int64_t
NumTrades
;
61
};
62
67
struct
AHSnapshot
{
68
AHDataHeader
header
;
69
char
MDStreamID
[4];
70
union
{
71
int64_t
OrigTime
;
72
int64_t
TradeTime
;
73
};
74
75
uint16_t
ChannelNo
;
76
char
InstrumentStatus
[2];
77
char
TradingPhaseCode
[4];
78
char
SecurityID
[8];
80
int64_t
BidPrice
[10];
81
int64_t
AskPrice
[10];
82
int64_t
BidVolume
[10];
83
int64_t
AskVolume
[10];
84
int64_t
PrevClosePx
;
85
int64_t
OpenPx
;
86
int64_t
HighPx
;
87
int64_t
LowPx
;
88
int64_t
LastPx
;
89
int64_t
ClosePx
;
90
int64_t
NumTrades
;
91
int64_t
TotalVolumeTrade
;
92
int64_t
TotalValueTrade
;
94
int64_t
TotalBidQty
;
95
int64_t
WeightedAvgBidPx
;
96
int64_t
TotalOfferQty
;
97
int64_t
WeightedAvgOfferPx
;
99
int64_t
IOPV
;
101
int64_t
LPV
;
102
int64_t
UpperLimitPrice
;
103
int64_t
LowerLimitPrice
;
104
int64_t
OpenInterest
;
105
int64_t
LastSubPrevClosePrice
;
106
int64_t
LastSubPrevLastPrice
;
107
};
108
109
namespace
AHType {
110
const
uint16_t ENTRUST = 192;
111
const
uint16_t TRADE = 191;
112
};
// namespace AHType
113
114
struct
AHTick
{
115
AHDataHeader
header
;
116
union
{
117
char
MDStreamID
[4];
118
uint16_t
OrderIndex
;
119
uint16_t
TradeIndex
;
120
};
121
122
union
{
123
uint16_t
ChannelNo
;
124
uint16_t
Channel
;
125
uint16_t
TradeChannel
;
126
};
127
128
union
{
129
char
Side
;
130
char
OrderBSFlag
;
131
char
TradeBSFlag
;
132
};
133
134
union
{
135
char
OrdType
;
136
char
OrderType
;
137
char
ExecType
;
138
};
139
140
union
{
141
int64_t
ApplSeqNum
;
142
int64_t
BizIndex
;
143
};
144
145
char
SecurityID
[8];
147
union
{
148
int64_t
Price
;
149
int64_t
OrderPrice
;
150
int64_t
LastPx
;
151
int64_t
TradePrice
;
152
};
153
154
union
{
155
int64_t
OrderQty
;
156
int64_t
Balance
;
157
int64_t
LastQty
;
158
int64_t
TradeQty
;
159
};
160
161
union
{
162
int64_t
TransactTime
;
163
int64_t
OrderTime
;
164
int64_t
TradeTime
;
165
};
166
167
union
{
168
int64_t
OrderNO
;
169
int64_t
BidApplSeqNum
;
170
int64_t
TradeBuyNo
;
171
};
172
173
union
{
174
int64_t
OfferApplSeqNum
;
175
int64_t
TradeSellNo
;
176
};
177
178
int64_t
TradeMony
;
179
};
180
181
#pragma pack(pop)
182
}
// namespace annhoo
183
#endif
annhoo::AHTick
Definition:
ah_md_common.h:114
annhoo::AHSnapshot::LowerLimitPrice
int64_t LowerLimitPrice
Definition:
ah_md_common.h:103
annhoo::AHIndex::PreCloseIndex
int64_t PreCloseIndex
Definition:
ah_md_common.h:53
annhoo::AHSnapshot::AskPrice
int64_t AskPrice[10]
Definition:
ah_md_common.h:81
annhoo::AHSnapshot::TotalVolumeTrade
int64_t TotalVolumeTrade
Definition:
ah_md_common.h:91
annhoo::AHTick::BidApplSeqNum
int64_t BidApplSeqNum
Definition:
ah_md_common.h:169
annhoo::AHTick::TradeSellNo
int64_t TradeSellNo
Definition:
ah_md_common.h:175
annhoo::AHTick::OrderNO
int64_t OrderNO
Definition:
ah_md_common.h:168
annhoo::AHSnapshot::OpenInterest
int64_t OpenInterest
Definition:
ah_md_common.h:104
annhoo::AHSnapshot::OrigTime
int64_t OrigTime
Definition:
ah_md_common.h:71
annhoo::AHTick::LastQty
int64_t LastQty
Definition:
ah_md_common.h:157
annhoo::AHTick::TransactTime
int64_t TransactTime
Definition:
ah_md_common.h:162
annhoo::AHSnapshot::WeightedAvgBidPx
int64_t WeightedAvgBidPx
Definition:
ah_md_common.h:95
annhoo::AHIndex::LowIndex
int64_t LowIndex
Definition:
ah_md_common.h:56
annhoo::AHTick::TradeIndex
uint16_t TradeIndex
Definition:
ah_md_common.h:119
annhoo::AHTick::TradeMony
int64_t TradeMony
Definition:
ah_md_common.h:178
annhoo::AHSnapshot::header
AHDataHeader header
Definition:
ah_md_common.h:68
annhoo::AHIndex::TotalVolumeTrade
int64_t TotalVolumeTrade
Definition:
ah_md_common.h:58
annhoo::AHTick::ApplSeqNum
int64_t ApplSeqNum
Definition:
ah_md_common.h:141
annhoo::AHSnapshot::ClosePx
int64_t ClosePx
Definition:
ah_md_common.h:89
annhoo::AHIndex::header
AHDataHeader header
Definition:
ah_md_common.h:41
annhoo::AHIndex::MDStreamID
char MDStreamID[4]
Definition:
ah_md_common.h:42
annhoo::AHSnapshot::LowPx
int64_t LowPx
Definition:
ah_md_common.h:87
annhoo::AHTick::ExecType
char ExecType
Definition:
ah_md_common.h:137
annhoo::AHTick::OrderPrice
int64_t OrderPrice
Definition:
ah_md_common.h:149
annhoo::AHSnapshot::PrevClosePx
int64_t PrevClosePx
Definition:
ah_md_common.h:84
annhoo::AHIndex::CloseIndex
int64_t CloseIndex
Definition:
ah_md_common.h:57
annhoo::AHIndex::ChannelNo
uint16_t ChannelNo
Definition:
ah_md_common.h:48
annhoo::AHIndex::NumTrades
int64_t NumTrades
Definition:
ah_md_common.h:60
annhoo::AHDataHeader::ExchangeID
char ExchangeID[2]
Definition:
ah_md_common.h:32
annhoo::AHTick::Price
int64_t Price
Definition:
ah_md_common.h:148
annhoo::AHTick::TradePrice
int64_t TradePrice
Definition:
ah_md_common.h:151
annhoo::AHTick::OrderBSFlag
char OrderBSFlag
Definition:
ah_md_common.h:130
annhoo::AHTick::BizIndex
int64_t BizIndex
Definition:
ah_md_common.h:142
annhoo::AHTick::TradeBuyNo
int64_t TradeBuyNo
Definition:
ah_md_common.h:170
annhoo::AHSnapshot::LPV
int64_t LPV
Definition:
ah_md_common.h:101
annhoo::AHIndex::TradeTime
int64_t TradeTime
Definition:
ah_md_common.h:45
annhoo::AHSnapshot::SecurityID
char SecurityID[8]
Definition:
ah_md_common.h:78
annhoo::AHTick::Side
char Side
Definition:
ah_md_common.h:129
annhoo::AHTick::OrdType
char OrdType
Definition:
ah_md_common.h:135
annhoo::AHTick::OrderTime
int64_t OrderTime
Definition:
ah_md_common.h:163
annhoo::AHSnapshot::BidPrice
int64_t BidPrice[10]
Definition:
ah_md_common.h:80
annhoo::AHTick::OrderType
char OrderType
Definition:
ah_md_common.h:136
annhoo::AHTick::OrderQty
int64_t OrderQty
Definition:
ah_md_common.h:155
annhoo::AHTick::SecurityID
char SecurityID[8]
Definition:
ah_md_common.h:145
annhoo::AHSnapshot::AskVolume
int64_t AskVolume[10]
Definition:
ah_md_common.h:83
annhoo::AHIndex::LastIndex
int64_t LastIndex
Definition:
ah_md_common.h:52
annhoo::AHSnapshot::TradeTime
int64_t TradeTime
Definition:
ah_md_common.h:72
annhoo::AHSnapshot::TotalValueTrade
int64_t TotalValueTrade
Definition:
ah_md_common.h:92
annhoo::AHSnapshot::NumTrades
int64_t NumTrades
Definition:
ah_md_common.h:90
annhoo::AHTick::OfferApplSeqNum
int64_t OfferApplSeqNum
Definition:
ah_md_common.h:174
annhoo::AHTick::ChannelNo
uint16_t ChannelNo
Definition:
ah_md_common.h:123
annhoo::AHIndex::HighIndex
int64_t HighIndex
Definition:
ah_md_common.h:55
annhoo::AHIndex::TotalValueTrade
int64_t TotalValueTrade
Definition:
ah_md_common.h:59
annhoo::AHIndex::SecurityID
char SecurityID[8]
Definition:
ah_md_common.h:51
annhoo::AHSnapshot::HighPx
int64_t HighPx
Definition:
ah_md_common.h:86
annhoo::AHTick::TradeQty
int64_t TradeQty
Definition:
ah_md_common.h:158
annhoo::AHTick::OrderIndex
uint16_t OrderIndex
Definition:
ah_md_common.h:118
annhoo::AHSnapshot::LastSubPrevLastPrice
int64_t LastSubPrevLastPrice
Definition:
ah_md_common.h:106
annhoo::AHTick::TradeBSFlag
char TradeBSFlag
Definition:
ah_md_common.h:131
annhoo::AHTick::header
AHDataHeader header
Definition:
ah_md_common.h:115
annhoo::AHSnapshot::BidVolume
int64_t BidVolume[10]
Definition:
ah_md_common.h:82
annhoo::AHTick::Channel
uint16_t Channel
Definition:
ah_md_common.h:124
annhoo::AHTick::TradeTime
int64_t TradeTime
Definition:
ah_md_common.h:164
annhoo::AHIndex
Contains data defined for index.
Definition:
ah_md_common.h:40
annhoo::AHTick::Balance
int64_t Balance
Definition:
ah_md_common.h:156
annhoo::AHSnapshot::IOPV
int64_t IOPV
Definition:
ah_md_common.h:99
annhoo::AHDataHeader::MsgType
uint16_t MsgType
Definition:
ah_md_common.h:31
annhoo::AHSnapshot::TradingPhaseCode
char TradingPhaseCode[4]
Definition:
ah_md_common.h:77
annhoo::AHIndex::OrigTime
int64_t OrigTime
Definition:
ah_md_common.h:44
annhoo::AHSnapshot::UpperLimitPrice
int64_t UpperLimitPrice
Definition:
ah_md_common.h:102
annhoo::AHTick::LastPx
int64_t LastPx
Definition:
ah_md_common.h:150
annhoo::AHSnapshot::MDStreamID
char MDStreamID[4]
Definition:
ah_md_common.h:69
annhoo::AHSnapshot::OpenPx
int64_t OpenPx
Definition:
ah_md_common.h:85
annhoo::AHSnapshot
Contains data defined for snapshot.
Definition:
ah_md_common.h:67
annhoo::AHSnapshot::InstrumentStatus
char InstrumentStatus[2]
Definition:
ah_md_common.h:76
annhoo::AHSnapshot::LastSubPrevClosePrice
int64_t LastSubPrevClosePrice
Definition:
ah_md_common.h:105
annhoo::AHSnapshot::ChannelNo
uint16_t ChannelNo
Definition:
ah_md_common.h:75
annhoo::AHSnapshot::TotalOfferQty
int64_t TotalOfferQty
Definition:
ah_md_common.h:96
annhoo::AHTick::TradeChannel
uint16_t TradeChannel
Definition:
ah_md_common.h:125
annhoo::AHSnapshot::WeightedAvgOfferPx
int64_t WeightedAvgOfferPx
Definition:
ah_md_common.h:97
annhoo::AHTick::MDStreamID
char MDStreamID[4]
Definition:
ah_md_common.h:117
annhoo::AHSnapshot::LastPx
int64_t LastPx
Definition:
ah_md_common.h:88
annhoo::AHIndex::OpenIndex
int64_t OpenIndex
Definition:
ah_md_common.h:54
annhoo::AHSnapshot::TotalBidQty
int64_t TotalBidQty
Definition:
ah_md_common.h:94
annhoo::AHIndex::TradingPhaseCode
char TradingPhaseCode[2]
Definition:
ah_md_common.h:49
annhoo::AHDataHeader
This is common header.
Definition:
ah_md_common.h:30