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