JayBeams  0.1
Another project to have fun coding.
net_order_imbalance_indicator_message.hpp
Go to the documentation of this file.
1 #ifndef jb_itch5_net_order_imbalance_indicator_message_hpp
2 #define jb_itch5_net_order_imbalance_indicator_message_hpp
3 
8 
9 namespace jb {
10 namespace itch5 {
11 
12 /**
13  * Represent the 'Imbalance Direction' field in the 'Net order
14  * Imbalance Indicator' message.
15  */
17 
18 /**
19  * Represent the 'Price Variation Indicator' field in the 'Net Order
20  * Imbalance Indicator' message.
21  */
22 typedef char_list_field<
23  u'L', u'1', u'2', u'3', u'4', u'5', u'6', u'7', u'8', u'9', u'A', u'B',
24  u'C', u' '>
26 
27 /**
28  * Represent an 'Net Order Imbalance Indicator' message in the
29  * ITCH-5.0 protocol.
30  */
32  constexpr static int message_type = u'I';
33 
35  std::uint64_t paired_shares;
36  std::uint64_t imbalance_shares;
37  imbalance_direction_t imbalance_direction;
44 };
45 
46 /// Specialize decoder for a jb::itch5::net_order_imbalance_indicator_message
47 template <bool V>
49  /// Please see the generic documentation for jb::itch5::decoder<>::r()
51  r(std::size_t size, void const* buf, std::size_t off) {
53  x.header = decoder<V, message_header>::r(size, buf, off + 0);
54  x.paired_shares = decoder<V, std::uint64_t>::r(size, buf, off + 11);
55  x.imbalance_shares = decoder<V, std::uint64_t>::r(size, buf, off + 19);
57  decoder<V, imbalance_direction_t>::r(size, buf, off + 27);
58  x.stock = decoder<V, stock_t>::r(size, buf, off + 28);
59  x.far_price = decoder<V, price4_t>::r(size, buf, off + 36);
60  x.near_price = decoder<V, price4_t>::r(size, buf, off + 40);
61  x.current_reference_price = decoder<V, price4_t>::r(size, buf, off + 44);
62  x.cross_type = decoder<V, cross_type_t>::r(size, buf, off + 48);
64  decoder<V, price_variation_indicator_t>::r(size, buf, off + 49);
65  return x;
66  }
67 };
68 
69 /// Streaming operator for jb::itch5::net_order_imbalance_indicator_message.
70 std::ostream&
71 operator<<(std::ostream& os, net_order_imbalance_indicator_message const& x);
72 
73 } // namespace itch5
74 } // namespace jb
75 
76 #endif // jb_itch5_net_order_imbalance_indicator_message_hpp
Define the header common to all ITCH 5.0 messages.
static T r(std::size_t size, void const *msg, std::size_t offset)
Read a single message or field.
char_list_field< u 'L', u '1', u '2', u '3', u '4', u '5', u '6', u '7', u '8', u '9', u 'A', u 'B', u 'C', u' '> price_variation_indicator_t
Represent the &#39;Price Variation Indicator&#39; field in the &#39;Net Order Imbalance Indicator&#39; message...
char_list_field< u 'B', u 'S', u 'N', u 'O'> imbalance_direction_t
Represent the &#39;Imbalance Direction&#39; field in the &#39;Net order Imbalance Indicator&#39; message.
Define the interface to decode ITCH-5.0 messages and message fields.
Definition: decoder.hpp:24
std::ostream & operator<<(std::ostream &os, add_order_message const &x)
Streaming operator for jb::itch5::add_order_message.
static net_order_imbalance_indicator_message r(std::size_t size, void const *buf, std::size_t off)
Please see the generic documentation for jb::itch5::decoder<>::r()
Represent an &#39;Net Order Imbalance Indicator&#39; message in the ITCH-5.0 protocol.
The top-level namespace for the JayBeams library.
Definition: as_hhmmss.hpp:7