OnixS ICE iMpact Multicast Price Feed Handler C++ library  8.18.0
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 "../Enumerations.h"
27 #include "../Export.h"
28 #include "../Types.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
40  {
41  messageType = 'C'
42  };
43 
44  /// Unique identifier of the market.
46 
47  /// See Appendix C for the list of market types and IDs.
49 
50  /// See Appendix A on the trading status codes.
52 
53  /// Electronic trade volume only, excluding block and other volumes.
54  int volume;
55 
56  /// Block volume.
58 
59  /// EFS volume.
60  int efsVolume;
61 
62  /// EFP volume.
63  int efpVolume;
64 
65  /// The number of open contracts of derivatives like futures and options
66  /// that have a time limit after which they expire. Open interest in a
67  /// derivative is the sum of all contracts that have not expired, been
68  /// exercised or physically delivered. Moreover, the open interest is the
69  /// number of long positions or, equivalently, the number of short
70  /// positions.
72 
73  /// Opening price. `DealPriceDenominator` for the market should be applied
74  /// to get the real price.
76 
77  /// Settlement price. `DealPriceDenominator` for the market should be
78  /// applied to get this price. This field is kept here for backward
79  /// compatibility. Client should use the new SettlementPrice field (added
80  /// in 1.1.14) for better precision. `DealPriceDenominator` and
81  /// `SettlePriceDenominator` might be different for some markets.
83 
84  /// High price. `DealPriceDenominator` for the market should be applied to
85  /// get the real price.
86  long long high;
87 
88  /// Low price. `DealPriceDenominator` for the market should be applied to
89  /// get the real price.
90  long long low;
91 
92  /// Weighted Average Price. `DealPriceDenominator` for the market should
93  /// be applied to get the real price.
94  long long vwap;
95 
96  /// Number of book entries in the market. It is the number of order
97  /// messages followed for full order depth snapshot channel. In case of
98  /// price level snapshot, it is the number of price level messages that
99  /// followed for the market.
101 
102  /// Last trade price. `DealPriceDenominator` for the market should be
103  /// applied to get the real price.
105 
106  /// Last trade quantity.
108 
109  /// Last trade date/time. Milliseconds since Jan 1st, 1970, 00:00:00 GMT.
111 
112  /// Settlement price date/time. Milliseconds since Jan 1st, 1970, 00:00:00
113  /// GMT. If there is no settlement price for endex silo, default value is
114  /// `0`. For other silos, the default value is `-1`.
116 
117  /// This should be used for synchronization with live update messages.
118  /// Please see the main technical specification for details on how it can
119  /// be done.
121 
122  /// The date Open Interest is effective for, in the format of YYYY-MM-DD.
123  std::string openInterestDate;
124 
125  /// Indicate if the SettlementPrice is official.
127 
128  /// Settlement price. `SettlePriceDenominator` for the market should be
129  /// applied to get the real settlement price.
131 
132  /// Indicate if the `PreviousSettlementDayPrice` populated. This field
133  /// will always be set to N for options.
135 
136  /// `SettlePriceDenominator` for the market should be applied to get the
137  /// real previous day settlement price. This field should be ignored if
138  /// `HasPreviousDaySettlementPrice` is set to `N`.
139  /// `PreviousDaySettlementPrice` will be sent for futures markets(not
140  /// options). From the start of the day until the settlement price is
141  /// published, the value of PDSP and settlement price would be the same.
142  /// Once the settlement price is published, PDSP would stay the same and
143  /// the settlement price would be updated to the current day settlement
144  /// price. If there is a holiday, the exchange will distribute the
145  /// PreviousDaySettlementPrice for the date that is specified on
146  /// `SettlePriceDateTime` (day before holiday) and
147  /// `HasPreviousDaySettlementPrice` will be set to `Y`.
149 
150  /// Default constructor.
151  MarketSnapshot();
152 
153  /// Initialize from raw message data.
154  MarketSnapshot(const char* data, std::size_t dataSize);
155 
156  /// Deserialize from raw data.
157  void deserialize(const char* data, std::size_t dataSize);
158 
159  /// Reset all fields to default values.
160  void reset();
161 
162  /// Returns string representation.
163  std::string toString() const;
164 };
165 
166 /// Make it printable using C++ I/O streams.
167 ONIXS_ICEMDH_EXPORT std::ostream& operator<<(std::ostream&, const MarketSnapshot&);
168 
169 }}}} // namespace OnixS::ICE::iMpact::MarketData
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