OnixS C++ Eurex T7 Market and Reference Data (EMDI, MDI, RDI, EOBI) Handlers  17.0.1
API documentation
DepthSnapshot.h
Go to the documentation of this file.
1 /*
2 * Copyright Onix Solutions Limited [OnixS]. All rights reserved.
3 *
4 * This software owned by Onix Solutions Limited [OnixS] and is protected by copyright law
5 * and international copyright treaties.
6 *
7 * Access to and use of the software is governed by the terms of the applicable OnixS Software
8 * Services Agreement (the Agreement) and Customer end user license agreements granting
9 * a non-assignable, non-transferable and non-exclusive license to use the software
10 * for it's own data processing purposes under the terms defined in the Agreement.
11 *
12 * Except as otherwise granted within the terms of the Agreement, copying or reproduction of any part
13 * of this source code or associated reference material to any other location for further reproduction
14 * or redistribution, and any amendments to this copyright notice, are expressly prohibited.
15 *
16 * Any reproduction or redistribution for sale or hiring of the Software not in accordance with
17 * the terms of the Agreement is a violation of copyright law.
18 */
19 
20 #pragma once
21 
27 
28 namespace OnixS
29 {
30  namespace Eurex
31  {
32  namespace MarketData
33  {
34  /// Exposes list of available sub book types.
36  {
37  enum Enum
38  {
39  /// Used to identify absence of value.
40  Undefined = -1,
41 
42  /// Mandatory Refresh
44 
45  /// Optional Refresh
47  };
48  };
49 
50  /// Market data snapshot entry.
51  class ONIXS_EUREX_EMDI_API MDSnapshotEntry : GroupInstance
52  {
53  public:
54 
55  /// Origin type.
57  {
58  return getIntEnumFieldValue<MDOriginType> (*this, Tags::MDOriginType);
59  }
60 
61  /// Defines the entry type.
63  {
64  return getIntEnumFieldValue<MDEntryType> (*this, Tags::MDEntryType);
65  }
66 
67  /// Top-of-book is only applicable to IPS, i.e. requires the presence of MDSubBookType.
69  {
70  return getIntEnumFieldValue<BookType> (*this, Tags::MDBookType);
71  }
72 
73  /// Optional qualifier to MDBookType.
75  {
76  return getIntEnumFieldValue<SubBookType> (*this, Tags::MDSubBookType);
77  }
78 
79  /// Defines when the trade happens.
80  ///
81  /// Only present for MDEntryType=Trade and TradeCondition=AW.
83  {
84  return getIntEnumFieldValue<TrdType> (*this, Tags::TrdType);
85  }
86 
87  /// Defines the trading session ID.
88  ///
89  /// @note Attached to MDEntryType 2=Trade and TradeCondition
90  /// U=Exchange Last unless there has been no trade so far.
91  /// In this case it is attached to book information which can simply
92  /// be Q=Auction Clearing Price or all bids and offers for the
93  /// currently visible depth (uncrossed book).
94  /// If there are no trades and no book information then it is attached
95  /// to J=Empty Book.
97  {
98  return getIntEnumFieldValue<TradingSessionId> (*this, Tags::TradingSessionID);
99  }
100 
101  /// Defines the trading session sub ID.
103  {
104  return getIntEnumFieldValue<TradingSessionSubID> (*this, Tags::TradingSessionSubID);
105  }
106 
107  /// Defines the TES trading session status.
109  {
110  return getIntEnumFieldValue<TradSesStatus> (*this, Tags::TESTradSesStatus);
111  }
112 
113  /// Indicator for stressed market conditions.
115  {
116  return getIntEnumFieldValue<MarketCondition>(*this, Tags::MarketCondition);
117  }
118 
119  /// MultiLegReportingType
121  {
122  return getNonZeroIntEnumFieldValue<MultiLegReportingType>(*this, Tags::MultiLegReportingType);
123  }
124 
125  /// MultiLegPriceModel
127  {
128  return getIntEnumFieldValue<MultiLegPriceModel>(*this, Tags::MultiLegPriceModel);
129  }
130 
131  /// Indicates if product is in the state Fast Market.
132  bool fastMarketIndicator() const
133  {
134  UInt32 value;
135  return (get (Tags::FastMarketIndicator).toNumber (value) ) ? (value == 1) : false;
136  }
137 
138  /// Defines the security trading status.
140  {
141  return getIntEnumFieldValue<SecurityTradingStatus> (*this, Tags::SecurityTradingStatus);
142  }
143 
144  /// Identifies an event related to a securityTradingStatus()
146  {
147  return getIntEnumFieldValue<SecurityTradingEvent> (*this, Tags::SecurityTradingEvent);
148  }
149 
150  /// Potential security trading event.
152  {
153  return getIntEnumFieldValue<SecurityTradingEvent> (*this, Tags::PotentialSecurityTradingEvent);
154  }
155 
156  /// Applicable for cash market products only (trading model continuous auction).
158  {
159  return getNonZeroIntEnumFieldValue<SoldOutIndicator>(*this, Tags::SoldOutIndicator);
160  }
161 
162  /// Upper boundary price.
163  bool highPx(Decimal& price) const
164  {
165  return get(Tags::HighPx).toNumber(price);
166  }
167 
168  /// Lower boundary price.
169  bool lowPx(Decimal& price) const
170  {
171  return get(Tags::LowPx).toNumber(price);
172  }
173 
174  /// Defines the trade �ondition.
175  ///
176  /// @note LastAuctionPrice is not be combined with any other value and have its own
177  /// entry in order to convey the auction type through TrdType. Instrument
178  /// state already changed to continuous when the auction
179  /// trade is reported.
181  {
182  UInt64 value;
183  return (get (Tags::TradeCondition).toNumber (value) ? TradeConditionSet (value) : TradeConditionSet (0) );
184  }
185 
186  /// Potential security trading event.
188  {
189  return getIntEnumFieldValue<QuoteCondition> (*this, Tags::QuoteCondition);
190  }
191 
192  /// Price.
193  bool mdEntryPx (Decimal& price) const
194  {
195  return get (Tags::MDEntryPx).toNumber (price);
196  }
197 
198  /// Quantity.
199  bool mdEntrySize (Decimal& size) const
200  {
201  return get (Tags::MDEntrySize).toNumber (size);
202  }
203 
204  /// Number Of Orders.
205  bool numberOfOrders (UInt32& number) const
206  {
207  return get (Tags::NumberOfOrders).toNumber (number);
208  }
209 
210  /// Book level.
211  ///
212  /// @note Absent for implied bid/offer prices.
213  bool mdPriceLevel (UInt32& level) const
214  {
215  return get (Tags::MDPriceLevel).toNumber (level);
216  }
217 
218  /// Time of entry (nanoseconds) for last trade entry only (TradeCondition="U").
219  bool mdEntryTime (UInt64& time) const
220  {
221  return get (Tags::MDEntryTime).toNumber (time);
222  }
223 
224  /// Non disclosed trade volumes.
225  bool nonDisclosedTradeVolume (Decimal& volume) const
226  {
227  return get (Tags::NonDisclosedTradeVolume).toNumber (volume);
228  }
229 
230  /// Total Number Of Trades.
231  ///
232  /// @note Only present for MDEntryType = Trade.
233  bool totalNumOfTrades (UInt32& number) const
234  {
235  return get (Tags::TotalNumOfTrades).toNumber (number);
236  }
237 
238  private:
240 
241  MDSnapshotEntry (const GroupInstance& groupInstance)
242  : GroupInstance (groupInstance)
243  {
244  }
245  };
246 
247  class MDSnapshotEntries : public TypedGroup<MDSnapshotEntry>
248  {
249  private:
250  explicit
251  MDSnapshotEntries (const Group& group)
253  {
254  }
255 
256  friend class DepthSnapshot;
257  };
258 
259  /// Depth snapshot
260  class ONIXS_EUREX_EMDI_API DepthSnapshot : public Message
261  {
262  public:
263 
264  /// Last message sequence number sent regardless of message type.
265  bool lastMsgSeqNumProcessed (UInt32& seqNum) const
266  {
267  return get (Tags::LastMsgSeqNumProcessed).toNumber (seqNum);
268  }
269 
270  /// Refresh Indicator
272  {
273  return getIntEnumFieldValue<RefreshIndicator>(*this, Tags::RefreshIndicator);
274  }
275 
276  /// Product identifier.
278  {
279  return getUInt32 (Tags::MarketSegmentID);
280  }
281 
282  /// Instrument identifier.
284  {
285  return getInt64 (Tags::SecurityID);
286  }
287 
288  /// Type of instrument
290  {
291  return getNonZeroIntEnumFieldValue<InstrumentType> (*this, Tags::ProductComplex);
292  }
293 
294  /// Security Status.
296  {
297  return getIntEnumFieldValue<SecurityStatus> (*this, Tags::SecurityStatus);
298  }
299 
300  /// Defines the TES security status.
302  {
303  return getIntEnumFieldValue<SecurityStatus> (*this, Tags::TESSecurityStatus);
304  }
305 
306  /// Time of last change for SecurityID (nanoseconds).
307  UInt64 lastUpdateTime() const
308  {
309  return getUInt64 (Tags::LastUpdateTime);
310  }
311 
312  /// Entries.
314  {
315  return MDSnapshotEntries ( getGroup (Tags::NoMDEntries) );
316  }
317 
318  private:
319  friend class DepthSnapshotWrapper;
320 
321  DepthSnapshot (const void* impl)
322  : Message (impl)
323  {
324  }
325  };
326  }
327  }
328 }
TradingSessionSubID::Enum tradingSessionSubID() const
Defines the trading session sub ID.
bool mdEntryPx(Decimal &price) const
Price.
InstrumentType::Enum productComplex() const
Type of instrument.
const Tag LastMsgSeqNumProcessed
Definition: Tags.h:65
SecurityStatus::Enum securityStatus() const
Security Status.
const Tag PotentialSecurityTradingEvent
Definition: Tags.h:191
bool totalNumOfTrades(UInt32 &number) const
MarketSegmentId marketSegmentId() const
Product identifier.
MDEntryType::Enum mdEntryType() const
Defines the entry type.
Definition: DepthSnapshot.h:62
const Tag MultiLegReportingType
Definition: Tags.h:236
bool mdPriceLevel(UInt32 &level) const
bool fastMarketIndicator() const
Indicates if product is in the state Fast Market.
bool mdEntryTime(UInt64 &time) const
Time of entry (nanoseconds) for last trade entry only (TradeCondition="U").
const Tag TradingSessionSubID
Definition: Tags.h:77
bool mdEntrySize(Decimal &size) const
Quantity.
TradSesStatus::Enum tesTradSesStatus() const
Defines the TES trading session status.
const Tag SecurityTradingStatus
Definition: Tags.h:61
SecurityId securityId() const
Instrument identifier.
unsigned int UInt32
Definition: Numeric.h:41
Definition: Defines.h:30
Decimal type for better precision.
Definition: Numeric.h:63
TradingSessionId::Enum tradingSessionId() const
Definition: DepthSnapshot.h:96
bool lastMsgSeqNumProcessed(UInt32 &seqNum) const
Last message sequence number sent regardless of message type.
Int64 SecurityId
Alias for Security Id type.
Definition: Defines.h:51
SecurityStatus::Enum tesSecurityStatus() const
Defines the TES security status.
bool numberOfOrders(UInt32 &number) const
Number Of Orders.
TradeConditionSet tradeCondition() const
MDOriginType::Enum mdOriginType() const
Origin type.
Definition: DepthSnapshot.h:56
const Tag RefreshIndicator
Definition: Tags.h:98
bool nonDisclosedTradeVolume(Decimal &volume) const
Non disclosed trade volumes.
Exposes list of available sub book types.
Definition: DepthSnapshot.h:35
MultiLegReportingType::Enum multiLegReportingType() const
MultiLegReportingType.
RefreshIndicator::Enum refreshIndicator() const
Refresh Indicator.
SubBookType::Enum mdSubBookType() const
Optional qualifier to MDBookType.
Definition: DepthSnapshot.h:74
MultiLegPriceModel::Enum multiLegPriceModel() const
MultiLegPriceModel.
MarketCondition::Enum marketCondition() const
Indicator for stressed market conditions.
const Tag SecurityTradingEvent
Definition: Tags.h:189
UInt64 lastUpdateTime() const
Time of last change for SecurityID (nanoseconds).
SoldOutIndicator::Enum soldOutIndicator() const
Applicable for cash market products only (trading model continuous auction).
SecurityTradingStatus::Enum securityTradingStatus() const
Defines the security trading status.
const Tag MultiLegPriceModel
Definition: Tags.h:237
UInt32 MarketSegmentId
Alias for Market Segment ID type.
Definition: Defines.h:40
BookType::Enum mdBookType() const
Top-of-book is only applicable to IPS, i.e. requires the presence of MDSubBookType.
Definition: DepthSnapshot.h:68
const Tag FastMarketIndicator
Definition: Tags.h:143
bool highPx(Decimal &price) const
Upper boundary price.
const Tag TradingSessionID
Definition: Tags.h:62
SecurityTradingEvent::Enum securityTradingEvent() const
Identifies an event related to a securityTradingStatus()
const Tag NonDisclosedTradeVolume
Definition: Tags.h:193
QuoteCondition::Enum quoteCondition() const
Potential security trading event.
bool lowPx(Decimal &price) const
Lower boundary price.
MDSnapshotEntries mdEntries() const
Entries.
SecurityTradingEvent::Enum potentialSecurityTradingEvent() const
Potential security trading event.
Market data snapshot entry.
Definition: DepthSnapshot.h:51