/
omx_itch186_message.h
179 lines (154 loc) · 4.44 KB
/
omx_itch186_message.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
#ifndef LIBTRADING_OMX_ITCH186_MESSAGE_H
#define LIBTRADING_OMX_ITCH186_MESSAGE_H
#ifdef __cplusplus
extern "C" {
#endif
#include "libtrading/types.h"
struct buffer;
/*
* Message types:
*/
enum omx_itch186_msg_type {
OMX_ITCH186_MSG_SECONDS = 'T', /* Section 4.1.1 */
OMX_ITCH186_MSG_MILLISECONDS = 'M', /* Section 4.1.2 */
OMX_ITCH186_MSG_SYSTEM_EVENT = 'S', /* Section 4.2.1 */
OMX_ITCH186_MSG_MARKET_SEGMENT_STATE = 'O', /* Section 4.2.2 */
OMX_ITCH186_MSG_ORDER_BOOK_DIRECTORY = 'R', /* Section 4.3.1 */
OMX_ITCH186_MSG_ORDER_BOOK_TRADING_ACTION = 'H', /* Section 4.3.2 */
OMX_ITCH186_MSG_ADD_ORDER = 'A', /* Section 4.4.1 */
OMX_ITCH186_MSG_ADD_ORDER_MPID = 'F', /* Section 4.4.2 */
OMX_ITCH186_MSG_ORDER_EXECUTED = 'E', /* Section 4.5.1 */
OMX_ITCH186_MSG_ORDER_EXECUTED_WITH_PRICE = 'C', /* Section 4.5.2 */
OMX_ITCH186_MSG_ORDER_CANCEL = 'X', /* Section 4.5.3 */
OMX_ITCH186_MSG_ORDER_DELETE = 'D', /* Section 4.5.4 */
OMX_ITCH186_MSG_TRADE = 'P', /* Section 4.6.1 */
OMX_ITCH186_MSG_CROSS_TRADE = 'Q', /* Section 4.6.2 */
OMX_ITCH186_MSG_BROKEN_TRADE = 'B', /* Section 4.7 */
OMX_ITCH186_MSG_NOII = 'I', /* Section 4.8 */
};
struct omx_itch186_message {
u8 MessageType;
} __attribute__((packed));
struct omx_itch186_msg_seconds {
u8 MessageType;
char Second[5];
} __attribute__((packed));
struct omx_itch186_msg_milliseconds {
u8 MessageType;
char Millisecond[3];
} __attribute__((packed));
struct omx_itch186_msg_system_event {
u8 MessageType;
char EventCode;
} __attribute__((packed));
struct omx_itch186_msg_market_segment_state {
u8 MessageType;
char MarketSegmentID[3];
char EventCode;
} __attribute__((packed));
struct omx_itch186_msg_order_book_directory {
u8 MessageType;
char OrderBook[6];
char Symbol[16];
char ISIN[12];
char FinancialProduct[3];
char TradingCurrency[3];
char MIC[4];
char MarketSegmentID[3];
char NoteCodes[8];
char RoundLotSize[9];
} __attribute__((packed));
struct omx_itch186_msg_order_book_trading_action {
u8 MessageType;
char OrderBook[6];
char TradingState;
char Reserved;
char Reason[4];
} __attribute__((packed));
struct omx_itch186_msg_add_order {
u8 MessageType;
char OrderReferenceNumber[9];
char BuySellIndicator;
char Quantity[9];
char OrderBook[6];
char Price[10];
} __attribute__((packed));
struct omx_itch186_msg_add_order_mpid {
u8 MessageType;
char OrderReferenceNumber[9];
char BuySellIndicator;
char Quantity[9];
char OrderBook[6];
char Price[10];
char Attribution[4];
} __attribute__((packed));
struct omx_itch186_msg_order_executed {
u8 MessageType;
char OrderReferenceNumber[9];
char ExecutedQuantity[9];
char MatchNumber[9];
char OwnerParticipantID[4];
char CounterpartyParticipantID[4];
} __attribute__((packed));
struct omx_itch186_msg_order_executed_with_price {
u8 MessageType;
char OrderReferenceNumber[9];
char ExecutedQuantity[9];
char MatchNumber[9];
char Printable;
char TradePrice[10];
char OwnerParticipantID[4];
char CounterpartyParticipantID[4];
} __attribute__((packed));
struct omx_itch186_msg_order_cancel {
u8 MessageType;
char OrderReferenceNumber[9];
char CanceledQuantity[9];
} __attribute__((packed));
struct omx_itch186_msg_order_delete {
u8 MessageType;
char OrderReferenceNumber[9];
} __attribute__((packed));
struct omx_itch186_msg_trade {
u8 MessageType;
char OrderReferenceNumber[9];
char TradeType;
char Quantity[9];
char OrderBook[6];
char MatchNumber[9];
char TradePrice[10];
char BuyerParticipantID[4];
char SellerParticipantID[4];
} __attribute__((packed));
struct omx_itch186_msg_cross_trade {
u8 MessageType;
char Quantity[9];
char OrderBook[6];
char CrossPrice[10];
char MatchNumber[9];
char CrossType;
char NumberOfTrades[10];
} __attribute__((packed));
struct omx_itch186_msg_broken_trade {
u8 MessageType;
char MatchNumber[9];
} __attribute__((packed));
struct omx_itch186_msg_noii {
u8 MessageType;
char PairedQuantity[9];
char ImbalanceQuantity[9];
char ImbalanceDirection;
char OrderBook[6];
char EquilibriumPrice[10];
char CrossType;
char BestBidPrice[10];
char BestBidQuantity[9];
char BestAskPrice[10];
char BestAskQuantity[9];
} __attribute__((packed));
unsigned long omx_itch186_message_size(u8 type);
struct omx_itch186_message *omx_itch186_message_decode(struct buffer *buf);
#ifdef __cplusplus
}
#endif
#endif