JayBeams  0.1
Another project to have fun coding.
Namespaces | Classes | Typedefs | Functions
jb::itch5 Namespace Reference

Contains classes and functions to parse NASDAQ ITCH-5.0 messages, more information about ITCH-5.0 can be found at: http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/NQTVITCHSpecification.pdf. More...

Namespaces

 defaults
 Default the default values for ITCH-5.x configuation.
 
 detail
 
 mold_udp_protocol
 MoldUDP64 protocol constants.
 
 protocol
 ITCH-5.x protocol constants.
 
 testing
 Functions used in testing jb::itch5 entities.
 

Classes

struct  add_order_message
 Represent an 'Add Order' message in the ITCH-5.0 protocol. More...
 
struct  add_order_mpid_message
 Represent an 'Add Order with MPID' message in the ITCH-5.0 protocol. More...
 
class  array_based_book_side
 Represent one side of the book. More...
 
struct  array_based_order_book
 Define the types of buy and sell side classes. More...
 
struct  book_update
 A flat struct to represent updates to an order book. More...
 
struct  broken_trade_message
 Represent an 'Broken Trade / Order Execution' message in the ITCH-5.0 protocol. More...
 
class  char_list_field
 A helper type to define char fields with a limited set of values. More...
 
struct  char_list_validator
 Define a functor to validate character fields with limited values. More...
 
struct  char_list_validator< true >
 Specialize for the empty list. More...
 
struct  char_list_validator< true, a, V... >
 Recursively define the validator for the enabled case. More...
 
class  compute_book
 Compute the book and call a user-defined callback on each change. More...
 
struct  cross_trade_message
 Represent an 'Add Order' message in the ITCH-5.0 protocol. More...
 
struct  decoder
 Define the interface to decode ITCH-5.0 messages and message fields. More...
 
struct  decoder< V, add_order_message >
 Specialize decoder for a jb::itch5::add_order_message. More...
 
struct  decoder< V, add_order_mpid_message >
 Specialize decoder for a jb::itch5::add_order_mpid_message. More...
 
struct  decoder< V, broken_trade_message >
 Specialize decoder for a jb::itch5::broken_trade_message. More...
 
struct  decoder< V, cross_trade_message >
 Specialize decoder for a jb::itch5::cross_trade_message. More...
 
struct  decoder< V, ipo_quoting_period_update_message >
 Specialize decoder for a jb::itch5::ipo_quoting_period_update_message. More...
 
struct  decoder< V, market_participant_position_message >
 Specialize decoder for a jb::itch5::market_participant_position_message. More...
 
struct  decoder< V, mwcb_breach_message >
 Specialize decoder for a jb::itch5::mwcb_breach_message. More...
 
struct  decoder< V, mwcb_decline_level_message >
 Specialize decoder for a jb::itch5::mwcb_decline_level_message. More...
 
struct  decoder< V, net_order_imbalance_indicator_message >
 Specialize decoder for a jb::itch5::net_order_imbalance_indicator_message. More...
 
struct  decoder< V, order_cancel_message >
 Specialize decoder for a jb::itch5::order_cancel_message. More...
 
struct  decoder< V, order_delete_message >
 Specialize decoder for a jb::itch5::order_delete_message. More...
 
struct  decoder< V, order_executed_message >
 Specialize decoder for a jb::itch5::order_executed_message. More...
 
struct  decoder< V, order_executed_price_message >
 Specialize decoder for a jb::itch5::order_executed_price_message. More...
 
struct  decoder< V, order_replace_message >
 Specialize decoder for a jb::itch5::order_replace_message. More...
 
struct  decoder< V, reg_sho_restriction_message >
 Specialize decoder for a jb::itch5::reg_sho_restriction_message. More...
 
struct  decoder< V, stock_directory_message >
 Specialize decoder for a jb::itch5::stock_directory_message. More...
 
struct  decoder< V, stock_trading_action_message >
 Specialize decoder for a jb::itch5::stock_trading_action_message. More...
 
struct  decoder< V, trade_message >
 Specialize decoder for a jb::itch5::trade_message. More...
 
struct  decoder< validate, char_list_field< V... > >
 Specialize decoder<bool,T> for char_list_field. More...
 
struct  decoder< validate, message_header >
 Specialize decoder for a jb::itch5::message_header. More...
 
struct  decoder< validate, price_field< wire_type_t, denom_v > >
 Specialize jb::itch5::decoder for jb::itch5::price_field. More...
 
struct  decoder< validate, seconds_field >
 Specialize jb::itch5::decoder<> for a seconds_field. More...
 
struct  decoder< validate, short_string_field< wsize, F > >
 Specialize decoder<bool,T> for short_string_field. More...
 
struct  decoder< validate, std::uint16_t >
 Specialize jb::itch5::decoder for 2-byte integer fields. More...
 
struct  decoder< validate, std::uint32_t >
 Specialize jb::itch5::decoder for 4-byte integer fields. More...
 
struct  decoder< validate, std::uint64_t >
 Specialize jb::itch5::decoder for 4-byte integer fields. More...
 
struct  decoder< validate, std::uint8_t >
 Specialize jb::itch5::decoder for 1-byte integer (or character) fields. More...
 
struct  decoder< validate, system_event_message >
 Specialize decoder for a jb::itch5::system_event_message. More...
 
struct  decoder< validate, timestamp >
 Specialize jb::itch5::decoder<> for a timestamp. More...
 
struct  encoder
 TODO(#19) all this code should be replaced with Boost.Endian. More...
 
struct  encoder< validate, std::uint16_t >
 Specialize jb::itch5::encoder for 2-byte integer fields. More...
 
struct  encoder< validate, std::uint32_t >
 Specialize jb::itch5::encoder for 4-byte integer fields. More...
 
struct  encoder< validate, std::uint64_t >
 Specialize jb::itch5::encoder for 4-byte integer fields. More...
 
struct  encoder< validate, std::uint8_t >
 Specialize jb::itch5::encoder for 1-byte integer (or character) fields. More...
 
struct  encoder< validate, timestamp >
 Specialize jb::itch5::encoder<> for a timestamp. More...
 
struct  ipo_quoting_period_update_message
 Represent a 'IPO Quotation Release Update' message in the ITCH-5.0 protocol. More...
 
class  map_based_book_side
 Represent one side of the book. More...
 
struct  map_based_order_book
 Define the types of buy and sell sides data structure. More...
 
struct  market_participant_position_message
 Represent a 'Market Participant Position' message in the ITCH-5.0 protocol. More...
 
class  message_handler_concept
 The interface for message_handlers in jb::itch5::process_iostream. More...
 
struct  message_header
 Define the header common to all ITCH 5.0 messages. More...
 
class  mold_udp_channel
 Create and manage a socket to receive MoldUDP64 packets. More...
 
struct  mold_udp_channel_tester
 Break encapsulation in jb::itch5::mold_udp_channel for testing purposes. More...
 
class  mold_udp_pacer
 Send a sequence of raw ITCH-5.x messages as MoldUDP64 packets, trying to match the original time interval between messages. More...
 
class  mold_udp_pacer_config
 Configuration object for the jb::itch5::mold_udp_pacer class. More...
 
struct  mwcb_breach_message
 Represent a 'MWCB Breach' message in the ITCH-5.0 protocol. More...
 
struct  mwcb_decline_level_message
 Represent a 'MWCB Decline Level' message in the ITCH-5.0 protocol. More...
 
struct  net_order_imbalance_indicator_message
 Represent an 'Net Order Imbalance Indicator' message in the ITCH-5.0 protocol. More...
 
struct  noop_validator
 A validator functor that accepts all values. More...
 
class  order_book
 Maintain the ITCH-5.0 order book for a single security. More...
 
struct  order_cancel_message
 Represent an 'Order Cancel' message in the ITCH-5.0 protocol. More...
 
struct  order_data
 A convenient container for per-order data. More...
 
struct  order_delete_message
 Represent an 'Order Delete' message in the ITCH-5.0 protocol. More...
 
struct  order_executed_message
 Represent an 'Order Executed' message in the ITCH-5.0 protocol. More...
 
struct  order_executed_price_message
 Represent an 'Order Executed with Price' message in the ITCH-5.0 protocol. More...
 
struct  order_replace_message
 Represent an 'Order Replace' message in the ITCH-5.0 protocol. More...
 
class  price_field
 Define a class used to represent prices in the ITCH-5.0 feed. More...
 
class  process_buffer_mlist
 Process a buffer with a single message: parse it and call the handler. More...
 
class  process_buffer_mlist< message_handler >
 Partial specialization for an empty list of messages. More...
 
class  process_buffer_mlist< message_handler, head_t, tail_t... >
 Partial specialization for a list with at least one message. More...
 
struct  reg_sho_restriction_message
 Represent a 'Reg SHO Restriction' message in the ITCH-5.0 protocol. More...
 
class  seconds_field
 Represent a ITCH-5.0 seconds_field. More...
 
class  short_string_field
 A helper type to define short (and fixed sized) string fields. More...
 
struct  stock_directory_message
 Represent a 'Stock Directory' message in the ITCH-5.0 protocol. More...
 
struct  stock_trading_action_message
 Represent a 'Stock Trading Action' message in the ITCH-5.0 protocol. More...
 
struct  system_event_message
 Represent a 'System Event Message' in the ITCH-5.0 protocol. More...
 
struct  timestamp
 Represent a ITCH-5.0 timestamp. More...
 
struct  trade_message
 Represent an 'Trade (non-Cross)' message in the ITCH-5.0 protocol. More...
 
class  udp_config_common
 Common configuration parameters for both UDP senders and receivers. More...
 
class  udp_receiver_config
 A configuration object for UDP receivers. More...
 
class  udp_sender_config
 A configuration object for UDP senders. More...
 
class  unknown_message
 A simple. More...
 
struct  validate_issue_subtype
 A functor to validate the 'Issue Sub-Type' field. More...
 

Typedefs

typedef char_list_field< u 'S', u 'B'> buy_sell_indicator_t
 Represent the 'Buy/Sell Indicator' field on several messages. More...
 
using clock_type = std::chrono::steady_clock
 A convenience alias for clock_type. More...
 
using time_point = clock_type::time_point
 A convenience alias for clock_type::time_point. More...
 
typedef char_list_field< u 'O', u 'C', u 'H', u 'I'> cross_type_t
 Represent the 'Cross Type' field on 'Cross Trade' and 'Net Order Imbalance Indicator' messages. More...
 
typedef char_list_field< u 'A', u 'C'> ipo_quotation_release_qualifier_t
 Represent the 'IPO Quotation Release Qualifier' field on a 'IPO Quoting Period Update' message. More...
 
typedef char_list_field< u 'Y', u 'N'> primary_market_maker_t
 Represent the 'Primary Market Maker' field on a 'Market Participant Position' message. More...
 
typedef char_list_field< u 'N', u 'P', u 'S', u 'R', u 'L' > market_maker_mode_t
 Represent the 'Market Maker Mode' field in a 'Market Participant Position' message. More...
 
typedef char_list_field< u 'A', u 'E', u 'W', u 'S', u 'D' > market_participant_state_t
 Represent the 'Market Participant State' field in a 'Market Participant Position' message. More...
 
typedef jb::itch5::short_string_field< 4 > mpid_t
 Define the type used to represent the 'MPID' field in many messages. More...
 
typedef char_list_field< u '1', u '2', u '3'> breached_level_t
 Represent the 'Breached Level' field in the 'MWCB Breach Message'. More...
 
typedef char_list_field< u 'B', u 'S', u 'N', u 'O'> imbalance_direction_t
 Represent the 'Imbalance Direction' field in the 'Net order Imbalance Indicator' message. More...
 
typedef 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 'Price Variation Indicator' field in the 'Net Order Imbalance Indicator' message. More...
 
using book_depth_t = unsigned long int
 Number of prices on a side order book. More...
 
typedef char_list_field< u 'Y', u 'N'> printable_t
 Represent the 'Printable' field on a 'Order Executed with Price' message. More...
 
typedef price_field< std::uint32_t, 10000 > price4_t
 Convenience definition for Price(4) fields. More...
 
typedef price_field< std::uint64_t, 100000000 > price8_t
 Convenience definition for Price(8) fields. More...
 
using half_quote = std::pair< price4_t, int >
 A simple representation for price + quantity. More...
 
typedef char_list_field< u '0', u '1', u '2'> reg_sho_action_t
 Represent the 'Reg SHO Action' field of the 'Reg SHO Restriction' message. More...
 
typedef char_list_field< u 'Q', u 'G', u 'S', u 'N', u 'A', u 'P', u 'Z', u' ' > market_category_t
 Represent the 'Market Category' field on a 'Stock Directory' message. More...
 
typedef char_list_field< u 'D', u 'E', u 'Q', u 'S', u 'G', u 'H', u 'J', u 'K', u 'C', u 'N', u' ' > financial_status_indicator_t
 Represent the 'Financial Status Indicator' field on a 'Stock Directory' message. More...
 
typedef char_list_field< u 'Y', u 'N'> roundlots_only_t
 Represent the 'Round Lots Only' field on a 'Stock Directory' message. More...
 
typedef char_list_field< u 'A', u 'B', u 'C', u 'F', u 'I', u 'L', u 'N', u 'O', u 'P', u 'Q', u 'R', u 'S', u 'T', u 'U', u 'V', u 'W' > issue_classification_t
 Represent the 'Issue Classification' field on a 'Stock Directory' message. More...
 
typedef short_string_field< 2, validate_issue_subtypeissue_subtype_t
 Represent the 'Issue Sub-Type' field on a 'Stock Directory' message. More...
 
typedef char_list_field< u 'P', u 'T' > authenticity_t
 Represent the 'Authenticity' field on a 'Stock Directory' message. More...
 
typedef char_list_field< u 'Y', u 'N', u' '> short_sale_threshold_indicator_t
 Represent the 'Short Sale Threshold Indicator' field on a 'Stock Directory' message. More...
 
typedef char_list_field< u 'Y', u 'N', u' '> ipo_flag_t
 Represent the 'IPO Flag' field on a 'Stock Directory' message. More...
 
typedef char_list_field< u '1', u '2', u' '> luld_reference_price_tier_t
 Represent the 'LULD Reference Price Tier' field on a 'Stock Directory' message. More...
 
typedef char_list_field< u 'Y', u 'N', u' '> etp_flag_t
 Represent the 'ETP Flag' field on a 'Stock Directory' message. More...
 
typedef char_list_field< u 'Y', u 'N'> inverse_indicator_t
 Represent the 'Inverse Indicator' field on a 'Stock Directory' message. More...
 
typedef jb::itch5::short_string_field< 8 > stock_t
 Define the type used to represent the 'Stock' field in many messages. More...
 
typedef char_list_field< u 'H', u 'P', u 'Q', u 'T'> trading_state_t
 Represent the 'Trading State' field on a 'Stock Trading Action' message. More...
 
typedef short_string_field< 4 > reason_t
 Represent the 'Reason' field in a 'Stock Trading Action' message. More...
 
typedef char_list_field< u 'O', u 'S', u 'Q', u 'M', u 'E', u 'C'> event_code_t
 Represent the 'Event Code' field on a 'System Event Message'. More...
 

Functions

std::ostream & operator<< (std::ostream &os, add_order_message const &x)
 Streaming operator for jb::itch5::add_order_message. More...
 
std::ostream & operator<< (std::ostream &os, add_order_mpid_message const &x)
 Streaming operator for jb::itch5::add_order_mpid_message. More...
 
std::ostream & operator<< (std::ostream &os, broken_trade_message const &x)
 Streaming operator for jb::itch5::broken_trade_message. More...
 
template<int... V>
std::ostream & operator<< (std::ostream &os, char_list_field< V... > const &x)
 Streaming operator for jb::itch5::char_list_field<> More...
 
void char_list_validation_failed (int x)
 Helper function, raises an exception describing a mismatched value. More...
 
template<bool validate>
void check_offset (char const *msg, std::size_t size, std::size_t offset, std::size_t n)
 Verify that an offset and field length is valid (generic version). More...
 
template<>
void check_offset< true > (char const *msg, std::size_t size, std::size_t offset, std::size_t n)
 A version of jb::itch5::check_offset<> that actually validates. More...
 
void raise_validation_failed (char const *where, char const *what)
 Convenience function to raise an exception upon a validation error. More...
 
bool operator== (book_update const &a, book_update const &b)
 
bool operator!= (book_update const &a, book_update const &b)
 
std::ostream & operator<< (std::ostream &os, book_update const &x)
 
std::ostream & operator<< (std::ostream &os, order_data const &x)
 
std::ostream & operator<< (std::ostream &os, cross_trade_message const &x)
 Streaming operator for jb::itch5::cross_trade_message. More...
 
template<typename duration_t , typename book_type >
bool record_latency_stats (jb::offline_feed_statistics &stats, jb::itch5::message_header const &header, jb::itch5::order_book< book_type > const &book, jb::itch5::book_update const &update, duration_t processing_latency)
 Determine if this event changes the inside, if so, record the statistics. More...
 
template<typename duration_t , typename book_type >
bool generate_inside (jb::offline_feed_statistics &stats, std::ostream &out, jb::itch5::message_header const &header, jb::itch5::order_book< book_type > const &book, jb::itch5::book_update const &update, duration_t processing_latency)
 Determine if this event changes the inside, if so, record the statistics and output the result. More...
 
std::ostream & operator<< (std::ostream &os, ipo_quoting_period_update_message const &x)
 Streaming operator for jb::itch5::ipo_quoting_period_update_message. More...
 
template<class socket_t = boost::asio::ip::udp::socket>
void make_socket_udp_common (socket_t &s, udp_config_common const &cfg)
 Configure a UDP socket. More...
 
template<class socket_t = boost::asio::ip::udp::socket>
socket_t make_socket_udp_recv (boost::asio::io_service &io, udp_receiver_config const &cfg)
 Create a socket given the configuration parameters. More...
 
template<class socket_t = boost::asio::ip::udp::socket>
socket_t make_socket_udp_send (boost::asio::io_service &io, udp_sender_config const &cfg)
 Create a socket to send UDP messages given the configuration parameters. More...
 
std::ostream & operator<< (std::ostream &os, market_participant_position_message const &x)
 Streaming operator for jb::itch5::market_participant_position_message. More...
 
std::ostream & operator<< (std::ostream &os, message_header const &x)
 Streaming operator for jb::itch5::message_header. More...
 
std::ostream & operator<< (std::ostream &os, mwcb_breach_message const &x)
 Streaming operator for jb::itch5::mwcb_breach_message. More...
 
std::ostream & operator<< (std::ostream &os, mwcb_decline_level_message const &x)
 Streaming operator for jb::itch5::mwcb_decline_level_message. More...
 
std::ostream & operator<< (std::ostream &os, net_order_imbalance_indicator_message const &x)
 Streaming operator for jb::itch5::net_order_imbalance_indicator_message. More...
 
std::ostream & operator<< (std::ostream &os, order_cancel_message const &x)
 Streaming operator for jb::itch5::order_cancel_message. More...
 
std::ostream & operator<< (std::ostream &os, order_delete_message const &x)
 Streaming operator for jb::itch5::order_delete_message. More...
 
std::ostream & operator<< (std::ostream &os, order_executed_message const &x)
 Streaming operator for jb::itch5::order_executed_message. More...
 
std::ostream & operator<< (std::ostream &os, order_executed_price_message const &x)
 Streaming operator for jb::itch5::order_executed_price_message. More...
 
std::ostream & operator<< (std::ostream &os, order_replace_message const &x)
 Streaming operator for jb::itch5::order_replace_message. More...
 
template<typename wire_type_t , std::intmax_t denom_v>
std::ostream & operator<< (std::ostream &os, price_field< wire_type_t, denom_v > const &x)
 Streaming operator for jb::itch5::price_field<> More...
 
template<typename price_field >
price_field max_price_field_value ()
 
template<>
price4_t max_price_field_value ()
 
template<typename price_field >
price_field operator+ (price_field const &lhs, price_field const &rhs)
 non-member addition operator More...
 
template<typename price_field_t >
std::size_t price_levels (price_field_t lo, price_field_t hi)
 Compute the number of price levels between two prices. More...
 
template<typename price_field_t >
auto level_to_price (typename price_field_t::wire_type const p_level)
 Compute the absolute price of a price level. More...
 
template<typename message_handler >
void process_iostream (std::istream &in, message_handler &handler)
 Process an iostream of ITCH-5.0 messages. More...
 
template<typename message_handler , typename... message_types>
void process_iostream_mlist (std::istream &is, message_handler &handler)
 
price4_t empty_bid_price ()
 convenient value to represent an empty bid limit price More...
 
price4_t empty_offer_price ()
 convenient value to represent an empty offer limit price More...
 
half_quote empty_bid ()
 The value used to represent an empty bid. More...
 
half_quote empty_offer ()
 The value used to represent an empty offer. More...
 
std::ostream & operator<< (std::ostream &os, reg_sho_restriction_message const &x)
 Streaming operator for jb::itch5::reg_sho_restriction_message. More...
 
template<bool validate>
void check_seconds_field_range (seconds_field const &t)
 Validate the a seconds_field value. More...
 
template<>
void check_seconds_field_range< true > (seconds_field const &t)
 Provide an active implementation of jb::itch5::check_seconds_field_range<> More...
 
std::ostream & operator<< (std::ostream &os, seconds_field const &x)
 Streaming operator for jb::itch5::seconds_field. More...
 
template<std::size_t size, typename F >
std::ostream & operator<< (std::ostream &os, short_string_field< size, F > const &x)
 Streaming operator for jb::itch5::short_string_field<> More...
 
template<std::size_t size, typename F >
std::size_t hash_value (short_string_field< size, F > const &x)
 Implement a hash function and integrate with boost::hash. More...
 
constexpr int static_digits (std::intmax_t value)
 Compute (at compile time if possible) the number of digits in a number. More...
 
std::ostream & operator<< (std::ostream &os, stock_directory_message const &x)
 Streaming operator for jb::itch5::stock_directory_message. More...
 
std::ostream & operator<< (std::ostream &os, stock_trading_action_message const &x)
 Streaming operator for jb::itch5::stock_trading_action_message. More...
 
std::ostream & operator<< (std::ostream &os, system_event_message const &x)
 Streaming operator for jb::itch5::system_event_message. More...
 
template<bool validate>
void check_timestamp_range (timestamp const &t)
 Validate the a timestamp value. More...
 
template<>
void check_timestamp_range< true > (timestamp const &t)
 Provide an active implementation of jb::itch5::check_timestamp_range<> More...
 
std::ostream & operator<< (std::ostream &os, timestamp const &x)
 Streaming operator for jb::itch5::timestamp. More...
 
std::ostream & operator<< (std::ostream &os, trade_message const &x)
 Streaming operator for jb::itch5::trade_message. More...
 

Detailed Description

Contains classes and functions to parse NASDAQ ITCH-5.0 messages, more information about ITCH-5.0 can be found at: http://www.nasdaqtrader.com/content/technicalsupport/specifications/dataproducts/NQTVITCHSpecification.pdf.


Class Documentation

◆ jb::itch5::array_based_order_book

struct jb::itch5::array_based_order_book

Define the types of buy and sell side classes.

It is used as template parameter book_type of the template classes order_book and compute_book:

  • usage: jb::itch5::order_book<jb::itch5::array_based_order_book>

Definition at line 87 of file array_based_order_book.hpp.

Class Members
typedef array_based_book_side
< greater< size_t > >
buys_t
typedef array_based_book_side
< less< size_t > >
sells_t

◆ jb::itch5::book_update

struct jb::itch5::book_update

A flat struct to represent updates to an order book.

Updates to an order book come in many forms, but they can all be represented with a simple structure that shows: what book is being updated, what side of the book is being updated, what price level is being updated, and how many shares are being added or removed from the book.

Definition at line 39 of file compute_book.hpp.

Class Members
buy_sell_indicator_t buy_sell_indicator What side of the book is being updated.
bool cxlreplx If true, this was a cancel replace and and old order was modified too...
price4_t oldpx Old price for the order.
int oldqty How many shares were removed in the old order.
price4_t px What price level is being updated.
int qty How many shares are being added (if positive) or removed (if negative) from the book.
time_point recvts When was the message that triggered this update received.
stock_t stock The security updated by this order.

This is redundant for order updates and deletes, and ITCH-5.0 omits the field, but we find it easier

◆ jb::itch5::map_based_order_book

struct jb::itch5::map_based_order_book

Define the types of buy and sell sides data structure.

It is used as template parameter book_type of the template class order_book:

  • usage: jb::itch5::order_book<jb::itch5::map_based_order_book>

Definition at line 26 of file map_based_order_book.hpp.

Class Members
typedef map_based_book_side
< greater< price4_t > >
buys_t
typedef map_based_book_side
< less< price4_t > >
sells_t

◆ jb::itch5::message_header

struct jb::itch5::message_header

Define the header common to all ITCH 5.0 messages.

Definition at line 15 of file message_header.hpp.

Class Members
int message_type The type of message.

ITCH-5.0 messages are identified by their first byte, with an ASCII value assigned to each message.

offset=0 width=1

int stock_locate The stock locate number.

Every stock receives a unique number in an ITCH-5.0 session. For messages that are not stock specific, this value is 0.

offset=1 width=2

timestamp timestamp The message timestamp, in nanoseconds since midnight.

All messages in a ITCH-5.0 session are timestamped, in nanoseconds since midnight for whatever day the session started running. All sessions are terminated before the end of the day.

offset=5 width=6

int tracking_number The "Tracking Number", a field designed for "internal NASDAQ purposes".

The ITCH-5.0 specification does not document how this field is to be interpreted.

offset=3 width=2

◆ jb::itch5::order_data

struct jb::itch5::order_data

A convenient container for per-order data.

Most market data feeds resend the security identifier and side with each order update, but ITCH-5.0 does not. One needs to lookup the symbol, side, original price, information based on the order id. This literal type is used to keep that information around.

Definition at line 82 of file compute_book.hpp.

Class Members
buy_sell_indicator_t buy_sell_indicator Whether the order is a BUY or SELL.
price4_t px The price of the order.
int qty The remaining quantity in the order.
stock_t stock The symbol for this particular order.

◆ jb::itch5::process_buffer_mlist

class jb::itch5::process_buffer_mlist

template<typename message_handler, typename... message_types>
class jb::itch5::process_buffer_mlist< message_handler, message_types >

Process a buffer with a single message: parse it and call the handler.

As messages are received and broken down by jb::itch5::process_iostream_mlist() they need to be parsed and then the right member function on the message handler must be invoked. Two partial specializations of this class implement this functionality. The fully generic version is, in fact, not implemented and this is intentional.

We use a class instead of a standalone function because partial template specialization for functions is not allowed in C++11, though it is trivially simulated, as show here.

Please see jb::itch5::message_handler_concept for a detailed description of the message_handler requirements.

Definition at line 30 of file process_buffer_mlist.hpp.

◆ jb::itch5::timestamp

struct jb::itch5::timestamp

Represent a ITCH-5.0 timestamp.

ITCH-5.0 uses nanoseconds since midnight for its timestamps.

Definition at line 17 of file timestamp.hpp.

Class Members
nanoseconds ts

Typedef Documentation

◆ authenticity_t

Represent the 'Authenticity' field on a 'Stock Directory' message.

Definition at line 95 of file stock_directory_message.hpp.

◆ book_depth_t

using jb::itch5::book_depth_t = typedef unsigned long int

Number of prices on a side order book.

Definition at line 17 of file order_book.hpp.

◆ breached_level_t

typedef char_list_field<u'1', u'2', u'3'> jb::itch5::breached_level_t

Represent the 'Breached Level' field in the 'MWCB Breach Message'.

Definition at line 13 of file mwcb_breach_message.hpp.

◆ buy_sell_indicator_t

Represent the 'Buy/Sell Indicator' field on several messages.

Definition at line 12 of file buy_sell_indicator.hpp.

◆ clock_type

using jb::itch5::clock_type = typedef std::chrono::steady_clock

A convenience alias for clock_type.

Definition at line 25 of file compute_book.hpp.

◆ cross_type_t

typedef char_list_field<u'O', u'C', u'H', u'I'> jb::itch5::cross_type_t

Represent the 'Cross Type' field on 'Cross Trade' and 'Net Order Imbalance Indicator' messages.

Definition at line 13 of file cross_type.hpp.

◆ etp_flag_t

typedef char_list_field<u'Y', u'N', u' '> jb::itch5::etp_flag_t

Represent the 'ETP Flag' field on a 'Stock Directory' message.

Definition at line 122 of file stock_directory_message.hpp.

◆ event_code_t

Represent the 'Event Code' field on a 'System Event Message'.

  • O: Start of Messages
  • S: Start of System hours
  • Q: Start of Market hours
  • M: End of Market hours
  • E: End of System hours
  • C: End of Messages

Definition at line 22 of file system_event_message.hpp.

◆ financial_status_indicator_t

typedef char_list_field< u'D', u'E', u'Q', u'S', u'G', u'H', u'J', u'K', u'C', u'N', u' ' > jb::itch5::financial_status_indicator_t

Represent the 'Financial Status Indicator' field on a 'Stock Directory' message.

Definition at line 44 of file stock_directory_message.hpp.

◆ half_quote

using jb::itch5::half_quote = typedef std::pair<price4_t, int>

A simple representation for price + quantity.

Definition at line 10 of file quote_defaults.hpp.

◆ imbalance_direction_t

typedef char_list_field<u'B', u'S', u'N', u'O'> jb::itch5::imbalance_direction_t

Represent the 'Imbalance Direction' field in the 'Net order Imbalance Indicator' message.

Definition at line 16 of file net_order_imbalance_indicator_message.hpp.

◆ inverse_indicator_t

Represent the 'Inverse Indicator' field on a 'Stock Directory' message.

Definition at line 128 of file stock_directory_message.hpp.

◆ ipo_flag_t

typedef char_list_field<u'Y', u'N', u' '> jb::itch5::ipo_flag_t

Represent the 'IPO Flag' field on a 'Stock Directory' message.

Definition at line 107 of file stock_directory_message.hpp.

◆ ipo_quotation_release_qualifier_t

Represent the 'IPO Quotation Release Qualifier' field on a 'IPO Quoting Period Update' message.

Definition at line 17 of file ipo_quoting_period_update_message.hpp.

◆ issue_classification_t

typedef char_list_field< u'A', u'B', u'C', u'F', u'I', u'L', u'N', u'O', u'P', u'Q', u'R', u'S', u'T', u'U', u'V', u'W' > jb::itch5::issue_classification_t

Represent the 'Issue Classification' field on a 'Stock Directory' message.

Definition at line 74 of file stock_directory_message.hpp.

◆ issue_subtype_t

Represent the 'Issue Sub-Type' field on a 'Stock Directory' message.

Definition at line 85 of file stock_directory_message.hpp.

◆ luld_reference_price_tier_t

Represent the 'LULD Reference Price Tier' field on a 'Stock Directory' message.

LULD stands for 'Limit Up, Limit Down', a restriction on pricing to avoid sudden drops or increases in price.

Definition at line 116 of file stock_directory_message.hpp.

◆ market_category_t

typedef char_list_field< u'Q', u'G', u'S', u'N', u'A', u'P', u'Z', u' ' > jb::itch5::market_category_t

Represent the 'Market Category' field on a 'Stock Directory' message.

Definition at line 24 of file stock_directory_message.hpp.

◆ market_maker_mode_t

typedef char_list_field< u'N', u'P', u'S', u'R', u'L' > jb::itch5::market_maker_mode_t

Represent the 'Market Maker Mode' field in a 'Market Participant Position' message.

Definition at line 29 of file market_participant_position_message.hpp.

◆ market_participant_state_t

typedef char_list_field< u'A', u'E', u'W', u'S', u'D' > jb::itch5::market_participant_state_t

Represent the 'Market Participant State' field in a 'Market Participant Position' message.

Definition at line 42 of file market_participant_position_message.hpp.

◆ mpid_t

Define the type used to represent the 'MPID' field in many messages.

Some ITCH-5.0 messages need to include information about the Market Participant that the message refers to. For example, members of the NASDAQ exchange may chose to identify their orders instead of trading anonymously. In the NASDAQ exchange each participant receives a 4-letter (all uppercase) identifier.

Definition at line 19 of file mpid_field.hpp.

◆ price4_t

typedef price_field<std::uint32_t, 10000> jb::itch5::price4_t

Convenience definition for Price(4) fields.

Definition at line 131 of file price_field.hpp.

◆ price8_t

typedef price_field<std::uint64_t, 100000000> jb::itch5::price8_t

Convenience definition for Price(8) fields.

Definition at line 134 of file price_field.hpp.

◆ price_variation_indicator_t

typedef 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' '> jb::itch5::price_variation_indicator_t

Represent the 'Price Variation Indicator' field in the 'Net Order Imbalance Indicator' message.

Definition at line 25 of file net_order_imbalance_indicator_message.hpp.

◆ primary_market_maker_t

Represent the 'Primary Market Maker' field on a 'Market Participant Position' message.

Definition at line 16 of file market_participant_position_message.hpp.

◆ printable_t

Represent the 'Printable' field on a 'Order Executed with Price' message.

Definition at line 17 of file order_executed_price_message.hpp.

◆ reason_t

Represent the 'Reason' field in a 'Stock Trading Action' message.

Definition at line 19 of file stock_trading_action_message.hpp.

◆ reg_sho_action_t

typedef char_list_field<u'0', u'1', u'2'> jb::itch5::reg_sho_action_t

Represent the 'Reg SHO Action' field of the 'Reg SHO Restriction' message.

Definition at line 15 of file reg_sho_restriction_message.hpp.

◆ roundlots_only_t

Represent the 'Round Lots Only' field on a 'Stock Directory' message.

Definition at line 50 of file stock_directory_message.hpp.

◆ short_sale_threshold_indicator_t

Represent the 'Short Sale Threshold Indicator' field on a 'Stock Directory' message.

Definition at line 101 of file stock_directory_message.hpp.

◆ stock_t

Define the type used to represent the 'Stock' field in many messages.

All the ITCH-5.0 messages that carry stock-specific information use an 8-byte alpha field to represent the stock symbol. Please see ITCH-5.0: Confused about Securities, Symbols, and Tickers for some commentary on NASDAQ's naming conventions.

Definition at line 18 of file stock_field.hpp.

◆ time_point

using jb::itch5::time_point = typedef clock_type::time_point

A convenience alias for clock_type::time_point.

Definition at line 28 of file compute_book.hpp.

◆ trading_state_t

typedef char_list_field<u'H', u'P', u'Q', u'T'> jb::itch5::trading_state_t

Represent the 'Trading State' field on a 'Stock Trading Action' message.

Definition at line 14 of file stock_trading_action_message.hpp.

Function Documentation

◆ char_list_validation_failed()

void jb::itch5::char_list_validation_failed ( int  x)

Helper function, raises an exception describing a mismatched value.

Definition at line 6 of file char_list_validator.cpp.

Referenced by jb::itch5::char_list_validator< validate, V >::operator()(), and jb::itch5::char_list_validator< true >::operator()().

◆ check_offset()

template<bool validate>
void jb::itch5::check_offset ( char const *  msg,
std::size_t  size,
std::size_t  offset,
std::size_t  n 
)

Verify that an offset and field length is valid (generic version).

Template Parameters
validateif true, actually validate the offset and length, otherwise this is a no-op.
Parameters
msga message to include in the exception (if any) raised when the validation fails.
sizethe size of the message
offsetthe offset into the message where we want to read data
nthe size of the data we want to read
Exceptions
std::runtime_errorif the validation fails.

Definition at line 25 of file check_offset.hpp.

References check_offset< true >(), raise_validation_failed(), and jb::testing::defaults::size.

Referenced by BOOST_AUTO_TEST_CASE().

◆ check_offset< true >()

template<>
void jb::itch5::check_offset< true > ( char const *  msg,
std::size_t  size,
std::size_t  offset,
std::size_t  n 
)

A version of jb::itch5::check_offset<> that actually validates.

Definition at line 7 of file check_offset.cpp.

References jb::testing::defaults::size.

Referenced by BOOST_AUTO_TEST_CASE(), and check_offset().

◆ check_seconds_field_range()

template<bool validate>
void jb::itch5::check_seconds_field_range ( seconds_field const &  t)

Validate the a seconds_field value.

In ITCH-5.0 messages the seconds_field represents nanoseconds since midnight. The protocol is designed to start new sessions at the beginning of each day, so seconds_fields cannot ever be more than 24 hours in nanoseconds.

Template Parameters
validateunless it is true the function is a no-op.
Exceptions
std::runtime_errorif tparam is true and the seconds_field is out of the expected range.

Definition at line 59 of file seconds_field.hpp.

References check_seconds_field_range< true >().

◆ check_seconds_field_range< true >()

template<>
void jb::itch5::check_seconds_field_range< true > ( seconds_field const &  t)

Provide an active implementation of jb::itch5::check_seconds_field_range<>

Definition at line 8 of file seconds_field.cpp.

Referenced by check_seconds_field_range().

◆ check_timestamp_range()

template<bool validate>
void jb::itch5::check_timestamp_range ( timestamp const &  t)

Validate the a timestamp value.

In ITCH-5.0 messages the timestamp represents nanoseconds since midnight. The protocol is designed to start new sessions at the beginning of each day, so timestamps cannot ever be more than 24 hours in nanoseconds.

Template Parameters
validateunless it is true the function is a no-op.
Exceptions
std::runtime_errorif tparam is true and the timestamp is out of the expected range.

Definition at line 35 of file timestamp.hpp.

References check_timestamp_range< true >().

◆ check_timestamp_range< true >()

template<>
void jb::itch5::check_timestamp_range< true > ( timestamp const &  t)

Provide an active implementation of jb::itch5::check_timestamp_range<>

Definition at line 8 of file timestamp.cpp.

Referenced by check_timestamp_range().

◆ empty_bid()

half_quote jb::itch5::empty_bid ( )
inline

◆ empty_bid_price()

price4_t jb::itch5::empty_bid_price ( )
inline

convenient value to represent an empty bid limit price

Definition at line 13 of file quote_defaults.hpp.

Referenced by empty_bid(), and jb::itch5::array_based_book_side< compare_t >::side< std::greater< std::size_t >, DUMMY >::empty_quote_price().

◆ empty_offer()

half_quote jb::itch5::empty_offer ( )
inline

◆ empty_offer_price()

price4_t jb::itch5::empty_offer_price ( )
inline

◆ generate_inside()

template<typename duration_t , typename book_type >
bool jb::itch5::generate_inside ( jb::offline_feed_statistics stats,
std::ostream &  out,
jb::itch5::message_header const &  header,
jb::itch5::order_book< book_type > const &  book,
jb::itch5::book_update const &  update,
duration_t  processing_latency 
)

Determine if this event changes the inside, if so, record the statistics and output the result.

Template Parameters
duration_tthe type used to record the processing latency, must be compatible with a duration in the std::chrono sense.
book_typethe type used to define order_book<book_type>, must be compatible with jb::itch5::map_price
Parameters
statswhere to record the statistics
outwhere to send the new inside quote if needed
header(unused) the header for the message that generated this book update
bookthe book updated
updatea report of the changes to the book
processing_latencythe time it took to process the event (before the any output is generated).
Returns
true if the inside is affected by the change, false otherwise.

Definition at line 78 of file generate_inside.hpp.

References jb::itch5::order_book< book_type >::best_bid(), jb::itch5::order_book< book_type >::best_offer(), record_latency_stats(), jb::itch5::book_update::stock, jb::itch5::message_header::stock_locate, jb::itch5::message_header::timestamp, and jb::itch5::timestamp::ts.

Referenced by main(), run_inside(), and jb::itch5::testing::test_generate_inside_basic().

◆ hash_value()

template<std::size_t size, typename F >
std::size_t jb::itch5::hash_value ( short_string_field< size, F > const &  x)

Implement a hash function and integrate with boost::hash.

Definition at line 185 of file short_string_field.hpp.

References jb::itch5::short_string_field< wire_size_value, value_validator >::c_str(), and jb::testing::defaults::size.

◆ level_to_price()

template<typename price_field_t >
auto jb::itch5::level_to_price ( typename price_field_t::wire_type const  p_level)

Compute the absolute price of a price level.

Parameters
p_levelprice level
Returns
absolute price
Exceptions
std::bad_rangeif p_level out of range

Definition at line 62 of file price_levels.hpp.

References price_levels().

◆ make_socket_udp_common()

template<class socket_t = boost::asio::ip::udp::socket>
void jb::itch5::make_socket_udp_common ( socket_t &  s,
udp_config_common const &  cfg 
)

Configure a UDP socket.

Template Parameters
socket_tthe type of socket to create. The main reason to change this type is for dependency injection during testing.
Parameters
sthe socket to configure.
cfgthe socket configuration.

Definition at line 23 of file make_socket_udp_common.hpp.

References jb::debug, jb::itch5::udp_config_common::debug, jb::itch5::udp_config_common::do_not_route, jb::itch5::udp_config_common::linger, jb::itch5::udp_config_common::linger_seconds, jb::itch5::udp_config_common::receive_buffer_size, jb::itch5::udp_config_common::receive_low_watermark, jb::itch5::udp_config_common::send_buffer_size, and jb::itch5::udp_config_common::send_low_watermark.

Referenced by BOOST_AUTO_TEST_CASE(), make_socket_udp_recv(), and make_socket_udp_send().

◆ make_socket_udp_recv()

template<class socket_t = boost::asio::ip::udp::socket>
socket_t jb::itch5::make_socket_udp_recv ( boost::asio::io_service &  io,
udp_receiver_config const &  cfg 
)

Create a socket given the configuration parameters.

This is a function to create (open) sockets to receive UDP messages, either unicast or multicast and either IPv4 or IPv6.

Template Parameters
socket_tthe type of socket to create. The main reason to change this type is for dependency injection during testing.
Parameters
iothe Boost.ASIO io_service object that the socket is managed by.
cfgthe configuration parameters for the socket.

Definition at line 71 of file make_socket_udp_recv.hpp.

References make_socket_udp_common(), and jb::itch5::detail::setup_socket_udp_recv().

Referenced by BOOST_AUTO_TEST_CASE().

◆ make_socket_udp_send()

template<class socket_t = boost::asio::ip::udp::socket>
socket_t jb::itch5::make_socket_udp_send ( boost::asio::io_service &  io,
udp_sender_config const &  cfg 
)

Create a socket to send UDP messages given the configuration parameters.

This is a function to create (open) sockets to send UDP messages, either unicast or multicast and either IPv4 or IPv6. The socket is bound to ADDRANY, and uses an ephemeral port selected by the operating system. The address family (v4 vs. v6) is selected based on the destination address.

Template Parameters
socket_tthe type of socket to create. The main reason to change this type is for dependency injection during testing.
Parameters
iothe Boost.ASIO io_service object that the socket is managed by.
cfgthe socket configuration.

Definition at line 89 of file make_socket_udp_send.hpp.

References make_socket_udp_common(), and jb::itch5::detail::setup_socket_udp_send().

Referenced by BOOST_AUTO_TEST_CASE().

◆ max_price_field_value() [1/2]

template<typename price_field >
price_field jb::itch5::max_price_field_value ( )
inline

◆ max_price_field_value() [2/2]

template<>
price4_t jb::itch5::max_price_field_value ( )
inline

◆ operator!=()

bool jb::itch5::operator!= ( book_update const &  a,
book_update const &  b 
)
inline

Definition at line 511 of file compute_book.hpp.

◆ operator+()

template<typename price_field >
price_field jb::itch5::operator+ ( price_field const &  lhs,
price_field const &  rhs 
)
inline

non-member addition operator

Definition at line 151 of file price_field.hpp.

◆ operator<<() [1/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
broken_trade_message const &  x 
)

◆ operator<<() [2/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
order_delete_message const &  x 
)

◆ operator<<() [3/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
order_cancel_message const &  x 
)

◆ operator<<() [4/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
order_executed_message const &  x 
)

◆ operator<<() [5/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
reg_sho_restriction_message const &  x 
)

◆ operator<<() [6/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
mwcb_decline_level_message const &  x 
)

◆ operator<<() [7/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
mwcb_breach_message const &  x 
)

◆ operator<<() [8/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
cross_trade_message const &  x 
)

◆ operator<<() [9/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
order_replace_message const &  x 
)

◆ operator<<() [10/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
add_order_message const &  x 
)

Streaming operator for jb::itch5::add_order_message.

Definition at line 8 of file add_order_message.cpp.

References jb::itch5::add_order_message::buy_sell_indicator, jb::itch5::add_order_message::header, jb::itch5::add_order_message::order_reference_number, jb::itch5::add_order_message::price, jb::itch5::add_order_message::shares, and jb::itch5::add_order_message::stock.

Referenced by jb::itch5::validate_issue_subtype::operator()(), jb::itch5::decoder< V, order_delete_message >::r(), jb::itch5::decoder< V, order_cancel_message >::r(), jb::itch5::decoder< V, broken_trade_message >::r(), jb::itch5::decoder< V, order_executed_message >::r(), jb::itch5::decoder< V, order_replace_message >::r(), jb::itch5::decoder< V, cross_trade_message >::r(), jb::itch5::decoder< V, trade_message >::r(), jb::itch5::decoder< V, add_order_message >::r(), jb::itch5::decoder< V, mwcb_decline_level_message >::r(), jb::itch5::decoder< V, reg_sho_restriction_message >::r(), jb::itch5::decoder< V, mwcb_breach_message >::r(), jb::itch5::decoder< V, ipo_quoting_period_update_message >::r(), jb::itch5::decoder< V, stock_trading_action_message >::r(), jb::itch5::decoder< validate, system_event_message >::r(), jb::itch5::decoder< V, add_order_mpid_message >::r(), jb::itch5::decoder< V, net_order_imbalance_indicator_message >::r(), jb::itch5::decoder< V, order_executed_price_message >::r(), jb::itch5::decoder< V, market_participant_position_message >::r(), jb::itch5::decoder< validate, message_header >::r(), jb::itch5::decoder< validate, seconds_field >::r(), jb::itch5::decoder< V, stock_directory_message >::r(), and jb::itch5::encoder< validate, timestamp >::w().

◆ operator<<() [11/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
trade_message const &  x 
)

◆ operator<<() [12/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
system_event_message const &  x 
)

◆ operator<<() [13/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
stock_trading_action_message const &  x 
)

◆ operator<<() [14/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
ipo_quoting_period_update_message const &  x 
)

◆ operator<<() [15/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
add_order_mpid_message const &  x 
)

◆ operator<<() [16/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
order_executed_price_message const &  x 
)

◆ operator<<() [17/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
net_order_imbalance_indicator_message const &  x 
)

◆ operator<<() [18/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
message_header const &  x 
)

◆ operator<<() [19/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
timestamp const &  x 
)

Streaming operator for jb::itch5::timestamp.

Definition at line 21 of file timestamp.cpp.

References jb::itch5::timestamp::ts.

◆ operator<<() [20/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
market_participant_position_message const &  x 
)

◆ operator<<() [21/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
seconds_field const &  x 
)

Streaming operator for jb::itch5::seconds_field.

Definition at line 20 of file seconds_field.cpp.

References jb::itch5::seconds_field::int_seconds().

◆ operator<<() [22/27]

template<int... V>
std::ostream& jb::itch5::operator<< ( std::ostream &  os,
char_list_field< V... > const &  x 
)

Streaming operator for jb::itch5::char_list_field<>

Definition at line 94 of file char_list_field.hpp.

References jb::itch5::char_list_field< V >::as_int().

◆ operator<<() [23/27]

template<typename wire_type_t , std::intmax_t denom_v>
std::ostream& jb::itch5::operator<< ( std::ostream &  os,
price_field< wire_type_t, denom_v > const &  x 
)

Streaming operator for jb::itch5::price_field<>

Definition at line 123 of file price_field.hpp.

◆ operator<<() [24/27]

template<std::size_t size, typename F >
std::ostream& jb::itch5::operator<< ( std::ostream &  os,
short_string_field< size, F > const &  x 
)

Streaming operator for jb::itch5::short_string_field<>

Definition at line 179 of file short_string_field.hpp.

◆ operator<<() [25/27]

std::ostream & jb::itch5::operator<< ( std::ostream &  os,
stock_directory_message const &  x 
)

◆ operator<<() [26/27]

std::ostream& jb::itch5::operator<< ( std::ostream &  os,
book_update const &  x 
)

◆ operator<<() [27/27]

std::ostream& jb::itch5::operator<< ( std::ostream &  os,
order_data const &  x 
)

◆ operator==()

bool jb::itch5::operator== ( book_update const &  a,
book_update const &  b 
)
inline

◆ price_levels()

template<typename price_field_t >
std::size_t jb::itch5::price_levels ( price_field_t  lo,
price_field_t  hi 
)

Compute the number of price levels between two prices.

Parameters
lothe low end of the range of price levels
hithe hi end of the range of price levels
Returns
the number of price levels between lo and hi
Exceptions
std::bad_rangeif hi < lo

Definition at line 20 of file price_levels.hpp.

Referenced by jb::itch5::array_based_book_side< compare_t >::add_order(), jb::itch5::array_based_book_side< compare_t >::get_limits(), level_to_price(), jb::itch5::array_based_book_side< compare_t >::price_levels_empty_quote(), and jb::itch5::array_based_book_side< compare_t >::reduce_order().

◆ process_iostream()

template<typename message_handler >
void jb::itch5::process_iostream ( std::istream &  in,
message_handler &  handler 
)

Process an iostream of ITCH-5.0 messages.

This is just a wrapper around jb::itch5::process_iostream_mlist() using all the messages in ITCH-5.0 as the allowed message list.

Please see jb::itch5::message_handler_concept for a detailed description of the message_handler requirements.

Definition at line 56 of file process_iostream.hpp.

Referenced by main(), and run_inside().

◆ process_iostream_mlist()

template<typename message_handler , typename... message_types>
void jb::itch5::process_iostream_mlist ( std::istream &  is,
message_handler &  handler 
)

◆ raise_validation_failed()

void jb::itch5::raise_validation_failed ( char const *  where,
char const *  what 
)

Convenience function to raise an exception upon a validation error.

Exceptions
std::runtime_error
Parameters
wherea string representing what class, function or component detected the problem.
whata string representing what value or expression failed its validation.

Definition at line 18 of file check_offset.cpp.

Referenced by check_offset(), and jb::itch5::short_string_field< 8 >::validate().

◆ record_latency_stats()

template<typename duration_t , typename book_type >
bool jb::itch5::record_latency_stats ( jb::offline_feed_statistics stats,
jb::itch5::message_header const &  header,
jb::itch5::order_book< book_type > const &  book,
jb::itch5::book_update const &  update,
duration_t  processing_latency 
)

Determine if this event changes the inside, if so, record the statistics.

Template Parameters
duration_tthe type used to record the processing latency, must be compatible with a duration in the std::chrono sense.
book_typethe type used to define the book type, order_book<book_type>, must be compatible with jb::itch5::map_price.
Parameters
statswhere to record the statistics
header(unused) the header for the message that generated this book update
bookthe book updated
updatea report of the changes to the book
processing_latencythe time it took to process the event (before the any output is generated).
Returns
true if the inside is affected by the change, false otherwise.

Definition at line 31 of file generate_inside.hpp.

References jb::itch5::order_book< book_type >::best_bid(), jb::itch5::order_book< book_type >::best_offer(), jb::itch5::book_update::buy_sell_indicator, jb::itch5::book_update::cxlreplx, jb::itch5::book_update::oldpx, jb::itch5::book_update::px, jb::offline_feed_statistics::sample(), jb::itch5::message_header::timestamp, and jb::itch5::timestamp::ts.

Referenced by generate_inside().

◆ static_digits()

constexpr int jb::itch5::static_digits ( std::intmax_t  value)

Compute (at compile time if possible) the number of digits in a number.

Definition at line 11 of file static_digits.hpp.

Referenced by BOOST_AUTO_TEST_CASE().