OnixS ICE iMpact Multicast Price Feed Handler C++ library  8.15.1
API documentation
MarketSnapshot.h
Go to the documentation of this file.
1 /**
2  * \file
3  * \brief Declare `OnixS::ICE::iMpact::MarketData::MarketSnapshot` message structure
4  */
5 /*
6  * Copyright (c) Onix Solutions Limited. All rights reserved.
7  *
8  * This software owned by Onix Solutions Limited and is protected by copyright law
9  * and international copyright treaties.
10  *
11  * Access to and use of the software is governed by the terms of the applicable ONIXS Software
12  * Services Agreement (the Agreement) and Customer end user license agreements granting
13  * a non-assignable, non-transferable and non-exclusive license to use the software
14  * for it's own data processing purposes under the terms defined in the Agreement.
15  *
16  * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
17  * of this source code or associated reference material to any other location for further reproduction
18  * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
19  *
20  * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
21  * the terms of the Agreement is a violation of copyright law.
22  */
23 
24 #pragma once
25 
26 #include "../Export.h"
27 #include "../Types.h"
28 #include "../Enumerations.h"
29 
30 #include <iosfwd>
31 #include <string>
32 
33 namespace OnixS { namespace ICE { namespace iMpact { namespace MarketData {
34 
35 /// This class represents the Market Snapshot Message.
36 struct ONIXS_ICEMDH_EXPORT MarketSnapshot
37 {
38  /// Message type constant
39  enum { messageType = 'C' };
40 
41  /// Unique identifier of the market.
43 
44  /// See Appendix C for the list of market types and IDs.
46 
47  /// See Appendix A on the trading status codes.
49 
50  /// Electronic trade volume only, excluding block and other volumes.
51  int volume;
52 
53  /// Block volume.
55 
56  /// EFS volume.
57  int efsVolume;
58 
59  /// EFP volume.
60  int efpVolume;
61 
62  /// The number of open contracts of derivatives like futures and options
63  /// that have a time limit after which they expire. Open interest in a
64  /// derivative is the sum of all contracts that have not expired, been
65  /// exercised or physically delivered. Moreover, the open interest is the
66  /// number of long positions or, equivalently, the number of short
67  /// positions.
69 
70  /// Opening price. `DealPriceDenominator` for the market should be applied
71  /// to get the real price.
73 
74  /// Settlement price. `DealPriceDenominator` for the market should be
75  /// applied to get this price. This field is kept here for backward
76  /// compatibility. Client should use the new SettlementPrice field (added
77  /// in 1.1.14) for better precision. `DealPriceDenominator` and
78  /// `SettlePriceDenominator` might be different for some markets.
80 
81  /// High price. `DealPriceDenominator` for the market should be applied to
82  /// get the real price.
83  long long high;
84 
85  /// Low price. `DealPriceDenominator` for the market should be applied to
86  /// get the real price.
87  long long low;
88 
89  /// Weighted Average Price. `DealPriceDenominator` for the market should
90  /// be applied to get the real price.
91  long long vwap;
92 
93  /// Number of book entries in the market. It is the number of order
94  /// messages followed for full order depth snapshot channel. In case of
95  /// price level snapshot, it is the number of price level messages that
96  /// followed for the market.
98 
99  /// Last trade price. `DealPriceDenominator` for the market should be
100  /// applied to get the real price.
102 
103  /// Last trade quantity.
105 
106  /// Last trade date/time. Milliseconds since Jan 1st, 1970, 00:00:00 GMT.
108 
109  /// Settlement price date/time. Milliseconds since Jan 1st, 1970, 00:00:00
110  /// GMT. If there is no settlement price for endex silo, default value is
111  /// `0`. For other silos, the default value is `-1`.
113 
114  /// This should be used for synchronization with live update messages.
115  /// Please see the main technical specification for details on how it can
116  /// be done.
118 
119  /// The date Open Interest is effective for, in the format of YYYY-MM-DD.
120  std::string openInterestDate;
121 
122  /// Indicate if the SettlementPrice is official.
124 
125  /// Settlement price. `SettlePriceDenominator` for the market should be
126  /// applied to get the real settlement price.
128 
129  /// Indicate if the `PreviousSettlementDayPrice` populated. This field
130  /// will always be set to N for options.
132 
133  /// `SettlePriceDenominator` for the market should be applied to get the
134  /// real previous day settlement price. This field should be ignored if
135  /// `HasPreviousDaySettlementPrice` is set to `N`.
136  /// `PreviousDaySettlementPrice` will be sent for futures markets(not
137  /// options). From the start of the day until the settlement price is
138  /// published, the value of PDSP and settlement price would be the same.
139  /// Once the settlement price is published, PDSP would stay the same and
140  /// the settlement price would be updated to the current day settlement
141  /// price. If there is a holiday, the exchange will distribute the
142  /// PreviousDaySettlementPrice for the date that is specified on
143  /// `SettlePriceDateTime` (day before holiday) and
144  /// `HasPreviousDaySettlementPrice` will be set to `Y`.
146 
147  /// Default constructor.
148  MarketSnapshot();
149 
150  /// Initialize from raw message data.
151  MarketSnapshot(const char* data, size_t dataSize);
152 
153  /// Deserialize from raw data.
154  void deserialize(const char* data, size_t dataSize);
155 
156  /// Reset all fields to default values.
157  void reset();
158 
159  /// Returns string representation.
160  std::string toString() const;
161 };
162 
163 /// Make it printable using C++ I/O streams.
164 ONIXS_ICEMDH_EXPORT std::ostream& operator<<(std::ostream&, const MarketSnapshot&);
165 
166 }}}} // namespace MarketData, iMpact, ICE, OnixS
DateTime lastTradeDateTime
Last trade date/time. Milliseconds since Jan 1st, 1970, 00:00:00 GMT.
short MarketType
Alias for market types.
Definition: Types.h:36
int volume
Electronic trade volume only, excluding block and other volumes.
long long Price
Alias for order identifiers type.
Definition: Types.h:54
This class represents the Market Snapshot Message.
TradingStatus::Enum tradingStatus
See Appendix A on the trading status codes.
MarketId marketId
Unique identifier of the market.
int MarketId
Alias for market identifiers type.
Definition: Types.h:39
std::ostream & operator<<(std::ostream &, const Error &)
Make it printable to formatted C++ I/O streams.
bool isSettlePriceOfficial
Indicate if the SettlementPrice is official.
MarketType marketType
See Appendix C for the list of market types and IDs.
std::string openInterestDate
The date Open Interest is effective for, in the format of YYYY-MM-DD.
long long DateTime
Represents the number of nanoseconds since Jan 1st, 1970, 00:00:00 GMT.
Definition: Types.h:57