OnixS ICE iMpact Multicast Price Feed Handler C++ library  8.18.0
API documentation
Trade.h
Go to the documentation of this file.
1 /**
2  * \file
3  * \brief Declare `OnixS::ICE::iMpact::MarketData::Trade` 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 "../Types.h"
29 
30 #include <iosfwd>
31 #include <string>
32 
33 namespace OnixS { namespace ICE { namespace iMpact { namespace MarketData {
34 
35 /// This class represents the Trade Message.
36 struct ONIXS_ICEMDH_EXPORT Trade
37 {
38  /// Message type constant
39  enum
40  {
41  messageType = 'G'
42  };
43 
44  /// MarketID of the instrument that was traded.
46 
47  /// Unique identifier of the trade message, unique per market.
49 
50  /// Indicate if it is a system priced leg.
52 
53  /// Price of the trade. `DealPriceDenominator` for the market should be
54  /// applied to get the real price.
56 
57  /// Trade quantity.
58  int quantity;
59 
60  /// Deal date time. Milliseconds since Jan 1st, 1970, 00:00:00 GMT.
62 
63  /// Indicates type of system priced leg.
65 
66  /// Indicate if the trade happens at market open due to spread implied.
67  /// When flag is true, such deal should not be included in market stats.
69 
70  /// Indicate if the trade is an adjusted trade.
72 
73  /// Used to identify which side of a trade the aggressor was on.
75 
76  /// Extra flags.
78 
79  /// Only for off market trade. The first character is `' '` when it is a
80  /// regular trade. One or two null characters (`'\\0'`) will be appended
81  /// to the end of this field when applicable. See Appendix B for the codes
82  /// and descriptions.
84 
85  /// Can be used in conjunction with `TransactDateTime` field for sequence
86  /// of deals within same milliseconds time.
88 
89  /// This field can be used to get the time the trading engine received the
90  /// request that triggers this message. The format is nanoseconds since
91  /// Jan 1st, 1970, 00:00:00 GMT. The nanosecond part is currently 000 and
92  /// might be supported later. Note: This field could be set to different
93  /// values or `0` for some scenarios. Please refer to the FAQs for more
94  /// details.
96 
97  /// Default constructor.
98  Trade();
99 
100  /// Initialize from raw message data.
101  Trade(const char* data, std::size_t dataSize);
102 
103  /// Deserialize from raw data.
104  void deserialize(const char* data, std::size_t dataSize);
105 
106  /// Reset all fields to default values.
107  void reset();
108 
109  /// Returns string representation.
110  std::string toString() const;
111 };
112 
113 /// Make it printable using C++ I/O streams.
114 ONIXS_ICEMDH_EXPORT std::ostream& operator<<(std::ostream&, const Trade&);
115 
116 }}}} // namespace OnixS::ICE::iMpact::MarketData
OffMarketTradeType::Enum offMarketTradeType
Definition: Trade.h:83
TradeExtraFlags::Enum extraFlags
Extra flags.
Definition: Trade.h:77
long long Price
Alias for order identifiers type.
Definition: Types.h:54
This class represents the Trade Message.
Definition: Trade.h:36
Enum
Known types of system priced legs.
Definition: Enumerations.h:520
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.
int quantity
Trade quantity.
Definition: Trade.h:58
bool isSystemPricedLeg
Indicate if it is a system priced leg.
Definition: Trade.h:51
DateTime transactDateTime
Deal date time. Milliseconds since Jan 1st, 1970, 00:00:00 GMT.
Definition: Trade.h:61
TradeId tradeId
Unique identifier of the trade message, unique per market.
Definition: Trade.h:48
SystemPricedLegType::Enum systemPricedLegType
Indicates type of system priced leg.
Definition: Trade.h:64
AggressorSide::Enum aggressorSide
Used to identify which side of a trade the aggressor was on.
Definition: Trade.h:74
long long TradeId
Alias for order identifiers type.
Definition: Types.h:45
DateTime requestTradingEngineReceivedTimestamp
Definition: Trade.h:95
MarketId marketId
MarketID of the instrument that was traded.
Definition: Trade.h:45
bool isAdjustedTrade
Indicate if the trade is an adjusted trade.
Definition: Trade.h:71
long long DateTime
Represents the number of nanoseconds since Jan 1st, 1970, 00:00:00 GMT.
Definition: Types.h:57