OnixS C++ Eurex T7 Market and Reference Data Interface (EMDI, RDI, EOBI) Handlers  7.4.3
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 getIntEnumFieldValue<SoldOutIndicator>(*this, Tags::SoldOutIndicator);
160  }
161 
162  /// Defines the trade ´┐Żondition.
163  ///
164  /// @note LastAuctionPrice is not be combined with any other value and have its own
165  /// entry in order to convey the auction type through TrdType. Instrument
166  /// state already changed to continuous when the auction
167  /// trade is reported.
169  {
170  UInt64 value;
171  return (get (Tags::TradeCondition).toNumber (value) ? TradeConditionSet (value) : TradeConditionSet (0) );
172  }
173 
174  /// Quote Condition.
175  bool quoteCondition (UInt32& value) const
176  {
177  return get (Tags::QuoteCondition).toNumber (value);
178  }
179 
180  /// Price.
181  bool mdEntryPx (Decimal& price) const
182  {
183  return get (Tags::MDEntryPx).toNumber (price);
184  }
185 
186  /// Quantity.
187  bool mdEntrySize (Decimal& size) const
188  {
189  return get (Tags::MDEntrySize).toNumber (size);
190  }
191 
192  /// Number Of Orders.
193  bool numberOfOrders (UInt32& number) const
194  {
195  return get (Tags::NumberOfOrders).toNumber (number);
196  }
197 
198  /// Book level.
199  ///
200  /// @note Absent for implied bid/offer prices.
201  bool mdPriceLevel (UInt32& level) const
202  {
203  return get (Tags::MDPriceLevel).toNumber (level);
204  }
205 
206  /// Time of entry (nanoseconds) for last trade entry only (TradeCondition="U").
207  bool mdEntryTime (UInt64& time) const
208  {
209  return get (Tags::MDEntryTime).toNumber (time);
210  }
211 
212  /// Non disclosed trade volumes.
213  bool nonDisclosedTradeVolume (Decimal& volume) const
214  {
215  return get (Tags::NonDisclosedTradeVolume).toNumber (volume);
216  }
217 
218  /// Total Number Of Trades.
219  ///
220  /// @note Only present for MDEntryType = Trade.
221  bool totalNumOfTrades (UInt32& number) const
222  {
223  return get (Tags::TotalNumOfTrades).toNumber (number);
224  }
225 
226  private:
228 
229  MDSnapshotEntry (const GroupInstance& groupInstance)
230  : GroupInstance (groupInstance)
231  {
232  }
233  };
234 
235  class MDSnapshotEntries : public TypedGroup<MDSnapshotEntry>
236  {
237  private:
238  explicit
239  MDSnapshotEntries (const Group& group)
241  {
242  }
243 
244  friend class DepthSnapshot;
245  };
246 
247  /// Depth snapshot
248  class ONIXS_EUREX_EMDI_API DepthSnapshot : public Message
249  {
250  public:
251 
252  /// Last message sequence number sent regardless of message type.
253  bool lastMsgSeqNumProcessed (UInt32& seqNum) const
254  {
255  return get (Tags::LastMsgSeqNumProcessed).toNumber (seqNum);
256  }
257 
258  /// Refresh Indicator
260  {
261  return getIntEnumFieldValue<RefreshIndicator>(*this, Tags::RefreshIndicator);
262  }
263 
264  /// Product identifier.
266  {
267  return getUInt32 (Tags::MarketSegmentID);
268  }
269 
270  /// Instrument identifier.
272  {
273  return getInt64 (Tags::SecurityID);
274  }
275 
276  /// Type of instrument
278  {
279  return getNonZeroIntEnumFieldValue<InstrumentType> (*this, Tags::ProductComplex);
280  }
281 
282  /// Security Status.
284  {
285  return getIntEnumFieldValue<SecurityStatus> (*this, Tags::SecurityStatus);
286  }
287 
288  /// Defines the TES security status.
290  {
291  return getIntEnumFieldValue<SecurityStatus> (*this, Tags::TESSecurityStatus);
292  }
293 
294  /// Time of last change for SecurityID (nanoseconds).
295  UInt64 lastUpdateTime() const
296  {
297  return getUInt64 (Tags::LastUpdateTime);
298  }
299 
300  /// Entries.
302  {
303  return MDSnapshotEntries ( getGroup (Tags::NoMDEntries) );
304  }
305 
306  private:
307  friend class DepthSnapshotWrapper;
308 
309  DepthSnapshot (const void* impl)
310  : Message (impl)
311  {
312  }
313  };
314  }
315  }
316 }
bool quoteCondition(UInt32 &value) const
Quote Condition.
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:67
SecurityStatus::Enum securityStatus() const
Security Status.
const Tag PotentialSecurityTradingEvent
Definition: Tags.h:209
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:255
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:80
bool mdEntrySize(Decimal &size) const
Quantity.
TradSesStatus::Enum tesTradSesStatus() const
Defines the TES trading session status.
const Tag SecurityTradingStatus
Definition: Tags.h:63
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
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:207
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:256
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:159
const Tag TradingSessionID
Definition: Tags.h:64
SecurityTradingEvent::Enum securityTradingEvent() const
Identifies an event related to a securityTradingStatus()
const Tag NonDisclosedTradeVolume
Definition: Tags.h:211
MDSnapshotEntries mdEntries() const
Entries.
SecurityTradingEvent::Enum potentialSecurityTradingEvent() const
Potential security trading event.
Market data snapshot entry.
Definition: DepthSnapshot.h:51