OnixS ICE iMpact Multicast Price Feed Handler C++ library  8.15.1
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  /// Default constructor.
165  Leg();
166 
167  /// Returns string representation.
168  std::string toString() const;
169  };
170 
171  /// Alias for collection of Legs.
172  typedef std::vector<Leg> Legs;
173 
174  /// Collection of Legs.
175  Legs legs;
176 
177  /// This nested class represents hedge definition.
178  struct ONIXS_ICEMDH_EXPORT Hedge
179  {
180  /// Future's market id of the hedge.
182 
183  /// Security type.
185 
186  /// Hedge side.
188 
189  /// Hedge price.
191 
192  /// Hedge price denominator.
194 
195  /// Hedge delta.
196  short delta;
197 
198  /// The strategy code for the leg. If set, this field can be used to
199  /// obtain the next level of granularity of the strategy. If it is not
200  /// set, the /c LegMarketID is the most granular level for the market. See
201  /// Appendix E for list of codes.
203 
204  /// Default constructor.
205  Hedge();
206 
207  /// Returns string representation.
208  std::string toString() const;
209  };
210 
211  /// Alias for collection of Hedges.
212  typedef std::vector<Hedge> Hedges;
213 
214  /// Collection of Hedges.
215  Hedges hedges;
216 
217  /// This nested class represents block details definition.
218  struct ONIXS_ICEMDH_EXPORT BlockDetail
219  {
220  /// Block Type.
222 
223  /// Trade Type.
225 
226  /// Minimum Quantity. `OffExchangeIncrementQtyDenominator` should be
227  /// applied to this field.
228  long long minQty;
229 
230  /// Default constructor.
231  BlockDetail();
232 
233  /// Returns string representation.
234  std::string toString() const;
235  };
236 
237  /// Alias for collection of BlockDetails.
238  typedef std::vector<BlockDetail> BlockDetails;
239 
240  /// Collection of BlockDetails.
241  BlockDetails blockDetails;
242 
243  /// Last date that the option market can be traded and should be removed
244  /// from the system.
246 
247  /// Indicates whether the Block Minimum can be overridden for the market.
249 
250  /// The product id for the market. For options, the ProductID will be that
251  /// of the underlying product.
253 
254  /// Number of cycles (days, hours, MWh, etc) for a contract.
256 
257  /// Minimum price. `OrderPriceDenominator` should be applied to this
258  /// field.
260 
261  /// Maximum price. `OrderPriceDenominator` should be applied to this
262  /// field.
264 
265  /// Default constructor.
267 
268  /// Initialize from raw message data.
269  OptionsStrategyDefinition(const char* data, size_t dataSize);
270 
271  /// Deserialize from raw data.
272  void deserialize(const char* data, size_t dataSize);
273 
274  /// Reset all fields to default values.
275  void reset();
276 
277  /// Returns string representation.
278  std::string toString() const;
279 };
280 
281 /// Make it printable using C++ I/O streams.
282 ONIXS_ICEMDH_EXPORT std::ostream& operator<<(std::ostream&, const OptionsStrategyDefinition&);
283 
284 }}}} // namespace MarketData, iMpact, ICE, OnixS
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