OnixS ICE iMpact Multicast Price Feed Handler C++ library  8.18.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 "../Enumerations.h"
27 #include "../Export.h"
28 #include "../Optional.h"
29 #include "../Time.h"
30 #include "../Types.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
43  {
44  messageType = 'q'
45  };
46 
47  /// The original request sequence ID assigned by client, unique per
48  /// session.
50 
51  /// See Appendix C for the list of market types and IDs.
53 
54  /// Unique identifier of the market.
56 
57  /// Unique identifier of the underlying market.
59 
60  /// See Naming Convention on Appendix D.
61  std::string contractSymbol;
62 
63  /// See Appendix A on trading status codes.
65 
66  /// Denominator for the order price fields in this market.
68 
69  /// Minimum increment premium price for this market.
71 
72  /// Minimum increment quantity for this market.
74 
75  /// Minimum quantity for this market.
76  int minQty;
77 
78  /// Contains the Strategy Code for defined market where applicable. See
79  /// Appendix E for list of codes.
81 
82  /// Indicates if Market is only tradable via ICE Block Trade. This also
83  /// means the screen trading is not allowed for the market.
85 
86  /// The number of options markets for the given market type.
88 
89  /// Strategy Symbol.
90  std::string strategySymbol;
91 
92  /// Indicates if GTC is allowed in the market.
93  bool gtAllowed;
94 
95  /// Indicates MIFID-II market.
97 
98  /// Denominator for the deal price fields in the market. For most markets,
99  /// this is the same as `OrderPriceDenominator`.
101 
102  /// Denominator for the settlement price fields in the market. For most
103  /// markets, this is the same as `DealPriceDenominator`.
105 
106  /// Denominator for `UnitQuantity`. This field will be `0` for most of the
107  /// markets.
109 
110  /// Indicates Test Market.
112 
113  /// Extra contract symbol. Some contract symbols might contain more than
114  /// 35 characters. Clients should append this field to ContractSymbol
115  /// (Offset 11) to get the complete contract symbol.
116  std::string contractSymbolExtra;
117 
118  /// Indicates whether leg deals are suppressed.
120 
121  /// Indicates if the contract is tradable.
123 
124  /// This nested class represents leg definition.
125  struct ONIXS_ICEMDH_EXPORT Leg
126  {
127  /// Market Id of the option leg market.
129 
130  /// Futures market id of the underlying futures market.
132 
133  /// Number of option contracts per increment quantity.
134  short ratio;
135 
136  /// Leg side.
138 
139  /// The strategy code for the leg. If set, this field can be used to
140  /// obtain the next level of granularity of the strategy. If it is not
141  /// set, the /c LegMarketID is the most granular level for the market. See
142  /// Appendix E for list of codes.
144 
145  /// The quantity ratio represents the proportion of each of the leg of
146  /// interproduct spreads. Using Gas Oil crack as an example. This will be
147  /// set to 4 for the Gas oil leg and 3 for the Brent leg.
149 
150  /// The quantity ratio represents the proportion of each of the leg of
151  /// interproduct spreads. The Leg ratio denominator will be set to `1` for
152  /// most products not but will be used in future product launches.
154 
155  /// The price ratio is the fractional weighted price component per leg in
156  /// the strategy. Using a Q4 2017 set as composite strategy as an example,
157  /// each leg Oct 2017, Nov 2017 and Dec 2017 will have 1 as the
158  /// `LegRatioPriceNumerator`.
160 
161  /// The price ratio is the fractional weighted price component per leg in
162  /// the strategy. Using a Q4 2017 set as composite strategy as an example,
163  /// each leg Oct 2017, Nov 2017 and Dec 2017 will have 3 as the
164  /// `LegRatioPriceDenominator`.
166 
167  /// Default constructor.
168  Leg();
169 
170  /// Returns string representation.
171  std::string toString() const;
172  };
173 
174  /// Alias for collection of Legs.
175  typedef std::vector<Leg> Legs;
176 
177  /// Collection of Legs.
178  Legs legs;
179 
180  /// This nested class represents hedge definition.
181  struct ONIXS_ICEMDH_EXPORT Hedge
182  {
183  /// Future's market id of the hedge.
185 
186  /// Security type.
188 
189  /// Hedge side.
191 
192  /// Hedge price.
194 
195  /// Hedge price denominator.
197 
198  /// Hedge delta.
199  short delta;
200 
201  /// The strategy code for the leg. If set, this field can be used to
202  /// obtain the next level of granularity of the strategy. If it is not
203  /// set, the /c LegMarketID is the most granular level for the market. See
204  /// Appendix E for list of codes.
206 
207  /// Default constructor.
208  Hedge();
209 
210  /// Returns string representation.
211  std::string toString() const;
212  };
213 
214  /// Alias for collection of Hedges.
215  typedef std::vector<Hedge> Hedges;
216 
217  /// Collection of Hedges.
218  Hedges hedges;
219 
220  /// This nested class represents block details definition.
221  struct ONIXS_ICEMDH_EXPORT BlockDetail
222  {
223  /// Block Type.
225 
226  /// Trade Type.
228 
229  /// Minimum Quantity. `OffExchangeIncrementQtyDenominator` should be
230  /// applied to this field.
231  long long minQty;
232 
233  /// Default constructor.
234  BlockDetail();
235 
236  /// Returns string representation.
237  std::string toString() const;
238  };
239 
240  /// Alias for collection of BlockDetails.
241  typedef std::vector<BlockDetail> BlockDetails;
242 
243  /// Collection of BlockDetails.
244  BlockDetails blockDetails;
245 
246  /// Last date that the option market can be traded and should be removed
247  /// from the system.
249 
250  /// Indicates whether the Block Minimum can be overridden for the market.
252 
253  /// The product id for the market. For options, the ProductID will be that
254  /// of the underlying product.
256 
257  /// Number of cycles (days, hours, MWh, etc) for a contract.
259 
260  /// Minimum price. `OrderPriceDenominator` should be applied to this
261  /// field.
263 
264  /// Maximum price. `OrderPriceDenominator` should be applied to this
265  /// field.
267 
268  /// Default constructor.
270 
271  /// Initialize from raw message data.
272  OptionsStrategyDefinition(const char* data, std::size_t dataSize);
273 
274  /// Deserialize from raw data.
275  void deserialize(const char* data, std::size_t dataSize);
276 
277  /// Reset all fields to default values.
278  void reset();
279 
280  /// Returns string representation.
281  std::string toString() const;
282 };
283 
284 /// Make it printable using C++ I/O streams.
285 ONIXS_ICEMDH_EXPORT std::ostream& operator<<(std::ostream&, const OptionsStrategyDefinition&);
286 
287 }}}} // namespace OnixS::ICE::iMpact::MarketData
Optional< int > numOfCycles
Number of cycles (days, hours, MWh, etc) for a contract.
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