dxFeed C API  6.0.1
dxFeed C API library intended to provide market data access for DX clients
RecordData.h
Go to the documentation of this file.
1 /*
2  * The contents of this file are subject to the Mozilla Public License Version
3  * 1.1 (the "License"); you may not use this file except in compliance with
4  * the License. You may obtain a copy of the License at
5  * http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS" basis,
8  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
9  * for the specific language governing rights and limitations under the
10  * License.
11  *
12  * The Initial Developer of the Original Code is dxFeed Solutions DE GmbH.
13  * Portions created by the Initial Developer are Copyright (C) 2010
14  * the Initial Developer. All Rights Reserved.
15  *
16  * Contributor(s):
17  *
18  */
19 
20 /*
21  * Here we have what's related to the records we receive from the server.
22  */
23 
24 #ifndef RECORD_DATA_H_INCLUDED
25 #define RECORD_DATA_H_INCLUDED
26 
27 #include "DXTypes.h"
28 
34 /* -------------------------------------------------------------------------- */
35 /*
36  * Record type constants
37  */
38 /* -------------------------------------------------------------------------- */
39 
41 typedef enum {
42  dx_rid_begin = 0,
43  dx_rid_trade = dx_rid_begin,
44  dx_rid_quote,
45  dx_rid_summary,
46  dx_rid_profile,
47  dx_rid_market_maker,
48  dx_rid_order,
49  dx_rid_time_and_sale,
50  dx_rid_candle,
51  dx_rid_trade_eth,
52  dx_rid_spread_order,
53  dx_rid_greeks,
54  dx_rid_theo_price,
55  dx_rid_underlying,
56  dx_rid_series,
57  dx_rid_configuration,
58 
59  /* add new values above this line */
60 
61  dx_rid_count,
62  dx_rid_invalid
64 
67 
68 /* Invalid or empty record id */
69 static const dx_record_id_t DX_RECORD_ID_INVALID = -1;
70 
71 /* -------------------------------------------------------------------------- */
72 /*
73  * Record structures
74  */
75 /* -------------------------------------------------------------------------- */
76 
78 typedef struct {
79  dxf_int_t time;
80  dxf_int_t sequence;
81  dxf_int_t time_nanos;
82  dxf_char_t exchange_code;
83  dxf_double_t price;
84  dxf_int_t size;
85  dxf_int_t tick;
86  dxf_double_t change;
87  dxf_int_t flags;
88  dxf_double_t day_volume;
89  dxf_double_t day_turnover;
90 } dx_trade_t;
91 
94 
96 typedef struct {
97  dxf_int_t sequence;
98  dxf_int_t time_nanos;
99  dxf_int_t bid_time;
100  dxf_char_t bid_exchange_code;
101  dxf_double_t bid_price;
102  dxf_int_t bid_size;
103  dxf_int_t ask_time;
104  dxf_char_t ask_exchange_code;
105  dxf_double_t ask_price;
106  dxf_int_t ask_size;
107 } dx_quote_t;
108 
110 typedef struct {
111  dxf_dayid_t day_id;
112  dxf_double_t day_open_price;
113  dxf_double_t day_high_price;
114  dxf_double_t day_low_price;
115  dxf_double_t day_close_price;
116  dxf_dayid_t prev_day_id;
117  dxf_double_t prev_day_close_price;
118  dxf_double_t prev_day_volume;
119  dxf_int_t open_interest;
120  dxf_int_t flags;
121 } dx_summary_t;
122 
124 typedef struct {
125  dxf_double_t beta;
126  dxf_double_t eps;
127  dxf_int_t div_freq;
128  dxf_double_t exd_div_amount;
129  dxf_dayid_t exd_div_date;
130  dxf_double_t _52_high_price;
131  dxf_double_t _52_low_price;
132  dxf_double_t shares;
133  dxf_double_t free_float;
134  dxf_double_t high_limit_price;
135  dxf_double_t low_limit_price;
136  dxf_int_t halt_start_time;
137  dxf_int_t halt_end_time;
138  dxf_int_t flags;
139  dxf_const_string_t description;
140  dxf_const_string_t status_reason;
141 } dx_profile_t;
142 
144 typedef struct {
145  dxf_char_t mm_exchange;
146  dxf_int_t mm_id;
147  dxf_int_t mmbid_time;
148  dxf_double_t mmbid_price;
149  dxf_int_t mmbid_size;
150  dxf_int_t mmbid_count;
151  dxf_int_t mmask_time;
152  dxf_double_t mmask_price;
153  dxf_int_t mmask_size;
154  dxf_int_t mmask_count;
156 
158 typedef struct {
159  dxf_int_t index;
160  dxf_int_t time;
161  dxf_int_t time_nanos;
162  dxf_int_t sequence;
163  dxf_double_t price;
164  dxf_int_t size;
165  dxf_int_t count;
166  dxf_int_t flags;
167  dxf_int_t mmid;
168 } dx_order_t;
169 
171 typedef struct {
172  dxf_int_t index;
173  dxf_int_t time;
174  dxf_int_t time_nanos;
175  dxf_int_t sequence;
176  dxf_double_t price;
177  dxf_int_t size;
178  dxf_int_t count;
179  dxf_int_t flags;
180  dxf_const_string_t spread_symbol;
182 
184 typedef struct {
185  dxf_int_t time;
186  dxf_int_t sequence;
187  dxf_char_t exchange_code;
188  dxf_double_t price;
189  dxf_int_t size;
190  dxf_double_t bid_price;
191  dxf_double_t ask_price;
192  dxf_int_t exchange_sale_conditions;
193  dxf_int_t flags;
194  dxf_const_string_t buyer;
195  dxf_const_string_t seller;
197 
199 typedef struct {
200  dxf_int_t time;
201  dxf_int_t sequence;
202  dxf_double_t count;
203  dxf_double_t open;
204  dxf_double_t high;
205  dxf_double_t low;
206  dxf_double_t close;
207  dxf_double_t volume;
208  dxf_double_t vwap;
209  dxf_double_t bid_volume;
210  dxf_double_t ask_volume;
211  dxf_int_t open_interest;
212  dxf_double_t imp_volatility;
213 } dx_candle_t;
214 
216 typedef struct {
217  dxf_int_t time;
218  dxf_int_t sequence;
219  dxf_double_t price;
220  dxf_double_t volatility;
221  dxf_double_t delta;
222  dxf_double_t gamma;
223  dxf_double_t theta;
224  dxf_double_t rho;
225  dxf_double_t vega;
226 } dx_greeks_t;
227 
229 typedef struct {
230  // To have same record for record and event
231  dxf_long_t time;
232  dxf_double_t price;
233  dxf_double_t underlying_price;
234  dxf_double_t delta;
235  dxf_double_t gamma;
236  dxf_double_t dividend;
237  dxf_double_t interest;
239 
241 typedef struct {
242  dxf_double_t volatility;
243  dxf_double_t front_volatility;
244  dxf_double_t back_volatility;
245  dxf_double_t put_call_ratio;
247 
249 typedef struct {
250  dxf_int_t index;
251  dxf_int_t time;
252  dxf_int_t sequence;
253  dxf_dayid_t expiration;
254  dxf_double_t volatility;
255  dxf_double_t put_call_ratio;
256  dxf_double_t forward_price;
257  dxf_double_t dividend;
258  dxf_double_t interest;
259 } dx_series_t;
260 
262 typedef struct {
263  dxf_int_t version;
264  dxf_byte_array_t object;
266 
267 #endif /* RECORD_DATA_H_INCLUDED */
Candle.
Definition: RecordData.h:199
Summary.
Definition: RecordData.h:110
Order.
Definition: RecordData.h:158
Byte array.
Definition: DXTypes.h:131
dx_record_info_id_t
Record info ID.
Definition: RecordData.h:41
int32_t dxf_int_t
Int.
Definition: DXTypes.h:99
int64_t dxf_long_t
Long.
Definition: DXTypes.h:108
Quote.
Definition: RecordData.h:96
Time & sale.
Definition: RecordData.h:184
dxf_int_t dx_record_id_t
Record ID.
Definition: RecordData.h:66
Profile.
Definition: RecordData.h:124
Series.
Definition: RecordData.h:249
Configuration.
Definition: RecordData.h:262
Underlying.
Definition: RecordData.h:241
Theo price.
Definition: RecordData.h:229
Market maker.
Definition: RecordData.h:144
wchar_t dxf_char_t
Char.
Definition: DXTypes.h:89
Greeks.
Definition: RecordData.h:216
int32_t dxf_dayid_t
DayId.
Definition: DXTypes.h:117
dxFeed C API types declarations
Spread order.
Definition: RecordData.h:171
const dxf_char_t * dxf_const_string_t
Const String.
Definition: DXTypes.h:123
double dxf_double_t
Double.
Definition: DXTypes.h:114
Trade.
Definition: RecordData.h:78
dx_trade_t dx_trade_eth_t
Trade Eth.
Definition: RecordData.h:93