OnixS ICE iMpact Multicast Price Feed Handler C++ library  8.11.0
API documentation
OptionsStrategyDefinition.h
Go to the documentation of this file.
1 /**
2  * \file
3  * \brief Declare `OnixS::ICE::iMpact::MarketData::OptionsStrategyDefinition` 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 #include "../Time.h"
30 #include "../Optional.h"
31 
32 #include <iosfwd>
33 #include <string>
34 #include <vector>
35 
36 namespace OnixS { namespace ICE { namespace iMpact { namespace MarketData {
37 
38 /// This class represents the Options Strategy Definition Message.
39 struct ONIXS_ICEMDH_EXPORT OptionsStrategyDefinition
40 {
41  /// Message type constant
42  enum { messageType = 'q' };
43 
44  /// The original request sequence ID assigned by client, unique per
45  /// session.
47 
48  /// See Appendix C for the list of market types and IDs.
50 
51  /// Unique identifier of the market.
53 
54  /// Unique identifier of the underlying market.
56 
57  /// See Naming Convention on Appendix D.
58  std::string contractSymbol;
59 
60  /// See Appendix A on trading status codes.
62 
63  /// Denominator for the order price fields in this market.
65 
66  /// Minimum increment premium price for this market.
68 
69  /// Minimum increment quantity for this market.
71 
72  /// Minimum quantity for this market.
73  int minQty;
74 
75  /// Contains the Strategy Code for defined market where applicable. See
76  /// Appendix E for list of codes.
78 
79  /// Indicates if Market is only tradable via ICE Block Trade. This also
80  /// means the screen trading is not allowed for the market.
82 
83  /// The number of options markets for the given market type.
85 
86  /// Strategy Symbol.
87  std::string strategySymbol;
88 
89  /// Indicates if GTC is allowed in the market.
90  bool gtAllowed;
91 
92  /// Indicates MIFID-II market.
94 
95  /// Denominator for the deal price fields in the market. For most markets,
96  /// this is the same as `OrderPriceDenominator`.
98 
99  /// Denominator for the settlement price fields in the market. For most
100  /// markets, this is the same as `DealPriceDenominator`.
102 
103  /// Denominator for `UnitQuantity`. This field will be `0` for most of the
104  /// markets.
106 
107  /// Indicates Test Market.
109 
110  /// Extra contract symbol. Some contract symbols might contain more than
111  /// 35 characters. Clients should append this field to ContractSymbol
112  /// (Offset 11) to get the complete contract symbol.
113  std::string contractSymbolExtra;
114 
115  /// Indicates whether leg deals are suppressed.
117 
118  /// Indicates if the contract is tradable.
120 
121  /// This nested class represents leg definition.
122  struct ONIXS_ICEMDH_EXPORT Leg
123  {
124  /// Market Id of the option leg market.
126 
127  /// Futures market id of the underlying futures market.
129 
130  /// Number of option contracts per increment quantity.
131  short ratio;
132 
133  /// Leg side.
135 
136  /// The strategy code for the leg. If set, this field can be used to
137  /// obtain the next level of granularity of the strategy. If it is not
138  /// set, the /c LegMarketID is the most granular level for the market. See
139  /// Appendix E for list of codes.
141 
142  /// The quantity ratio represents the proportion of each of the leg of
143  /// interproduct spreads. Using Gas Oil crack as an example. This will be
144  /// set to 4 for the Gas oil leg and 3 for the Brent leg.
146 
147  /// The quantity ratio represents the proportion of each of the leg of
148  /// interproduct spreads. The Leg ratio denominator will be set to `1` for
149  /// most products not but will be used in future product launches.
151 
152  /// The price ratio is the fractional weighted price component per leg in
153  /// the strategy. Using a Q4 2017 set as composite strategy as an example,
154  /// each leg Oct 2017, Nov 2017 and Dec 2017 will have 1 as the
155  /// `LegRatioPriceNumerator`.
157 
158  /// The price ratio is the fractional weighted price component per leg in
159  /// the strategy. Using a Q4 2017 set as composite strategy as an example,
160  /// each leg Oct 2017, Nov 2017 and Dec 2017 will have 3 as the
161  /// `LegRatioPriceDenominator`.
163 
164  /// Returns string representation.
165  std::string toString() const;
166  };
167 
168  /// Alias for collection of Legs.
169  typedef std::vector<Leg> Legs;
170 
171  /// Collection of Legs.
172  Legs legs;
173 
174  /// This nested class represents hedge definition.
175  struct ONIXS_ICEMDH_EXPORT Hedge
176  {
177  /// Future's market id of the hedge.
179 
180  /// Security type.
182 
183  /// Hedge side.
185 
186  /// Hedge price.
188 
189  /// Hedge price denominator.
191 
192  /// Hedge delta.
193  short delta;
194 
195  /// The strategy code for the leg. If set, this field can be used to
196  /// obtain the next level of granularity of the strategy. If it is not
197  /// set, the /c LegMarketID is the most granular level for the market. See
198  /// Appendix E for list of codes.
200 
201  /// Returns string representation.
202  std::string toString() const;
203  };
204 
205  /// Alias for collection of Hedges.
206  typedef std::vector<Hedge> Hedges;
207 
208  /// Collection of Hedges.
209  Hedges hedges;
210 
211  /// This nested class represents block details definition.
212  struct ONIXS_ICEMDH_EXPORT BlockDetail
213  {
214  /// Block Type.
216 
217  /// Trade Type.
219 
220  /// Minimum Quantity. `OffExchangeIncrementQtyDenominator` should be
221  /// applied to this field.
222  long long minQty;
223 
224  /// Returns string representation.
225  std::string toString() const;
226  };
227 
228  /// Alias for collection of BlockDetails.
229  typedef std::vector<BlockDetail> BlockDetails;
230 
231  /// Collection of BlockDetails.
232  BlockDetails blockDetails;
233 
234  /// Last date that the option market can be traded and should be removed
235  /// from the system.
237 
238  /// Indicates whether the Block Minimum can be overridden for the market.
240 
241  /// The product id for the market. For options, the ProductID will be that
242  /// of the underlying product.
244 
245  /// Number of cycles (days, hours, MWh, etc) for a contract. Replaces
246  /// OldNumOfCycles (id=38).
248 
249  /// Default constructor.
251 
252  /// Initialize from raw message data.
253  OptionsStrategyDefinition(const char* data, size_t dataSize);
254 
255  /// Deserialize from raw data.
256  void deserialize(const char* data, size_t dataSize);
257 
258  /// Reset all fields to default values.
259  void reset();
260 
261  /// Returns string representation.
262  std::string toString() const;
263 };
264 
265 /// Make it printable using C++ I/O streams.
266 ONIXS_ICEMDH_EXPORT std::ostream& operator<<(std::ostream&, const OptionsStrategyDefinition&);
267 
268 }}}} // namespace MarketData, iMpact, ICE, OnixS
std::string contractSymbol
See Naming Convention on Appendix D.
std::vector< Hedge > Hedges
Alias for collection of Hedges.
std::vector< BlockDetail > BlockDetails
Alias for collection of BlockDetails.
short MarketType
Alias for market types.
Definition: Types.h:36
bool legDealSuppressed
Indicates whether leg deals are suppressed.
long long Price
Alias for order identifiers type.
Definition: Types.h:54
TradingStatus::Enum tradingStatus
See Appendix A on trading status codes.
MarketType requestMarketType
See Appendix C for the list of market types and IDs.
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 gtAllowed
Indicates if GTC is allowed in the market.
short ratio
Number of option contracts per increment quantity.
char orderPriceDenominator
Denominator for the order price fields in this market.
MarketId underlyingMarketId
Futures market id of the underlying futures market.
std::vector< Leg > Legs
Alias for collection of Legs.
int incrementQty
Minimum increment quantity for this market.
This class represents the Options Strategy Definition Message.
Optional< bool > overrideBlockMin
Indicates whether the Block Minimum can be overridden for the market.
int incrementPrice
Minimum increment premium price for this market.
int numOfMarkets
The number of options markets for the given market type.
MarketId underlyingMarketId
Unique identifier of the underlying market.
Enum
Trading side constants.
Definition: Enumerations.h:38