JayBeams  0.1
Another project to have fun coding.
Classes | Namespaces | Typedefs | Functions
compute_book.hpp File Reference
#include <jb/itch5/add_order_message.hpp>
#include <jb/itch5/add_order_mpid_message.hpp>
#include <jb/itch5/order_book.hpp>
#include <jb/itch5/order_cancel_message.hpp>
#include <jb/itch5/order_delete_message.hpp>
#include <jb/itch5/order_executed_message.hpp>
#include <jb/itch5/order_executed_price_message.hpp>
#include <jb/itch5/order_replace_message.hpp>
#include <jb/itch5/stock_directory_message.hpp>
#include <jb/itch5/unknown_message.hpp>
#include <jb/assert_throw.hpp>
#include <boost/functional/hash.hpp>
#include <chrono>
#include <functional>
#include <unordered_map>

Go to the source code of this file.

Classes

struct  jb::itch5::book_update
 A flat struct to represent updates to an order book. More...
 
struct  jb::itch5::order_data
 A convenient container for per-order data. More...
 
class  jb::itch5::compute_book< book_type >
 Compute the book and call a user-defined callback on each change. More...
 

Namespaces

 jb
 The top-level namespace for the JayBeams library.
 
 jb::itch5
 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.
 

Typedefs

using jb::itch5::clock_type = std::chrono::steady_clock
 A convenience alias for clock_type. More...
 
using jb::itch5::time_point = clock_type::time_point
 A convenience alias for clock_type::time_point. More...
 

Functions

bool jb::itch5::operator== (book_update const &a, book_update const &b)
 
bool jb::itch5::operator!= (book_update const &a, book_update const &b)
 
std::ostream & jb::itch5::operator<< (std::ostream &os, book_update const &x)
 
std::ostream & jb::itch5::operator<< (std::ostream &os, order_data const &x)
 

Class Documentation

◆ 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::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.