ITCHCPP 1.6.0
High-Performance NASDAQ TotalView-ITCH 5.0 Parser & Market-Data Platform
Loading...
Searching...
No Matches
itch::analytics Namespace Reference

Classes

struct  Auction
 A reconstructed auction (cross) event. More...
 
class  AuctionTracker
 Reconstructs auctions from the NOII and Cross Trade message stream. More...
 
struct  Bar
 One OHLCV bar aggregated from the trade tape. More...
 
class  BarBuilder
 Builds OHLCV bars from a trade stream under a configurable clock. More...
 
struct  ImbalanceInfo
 A usable, decoded view of a Net Order Imbalance Indicator (I) message. More...
 
struct  TickClock
 A clock that buckets a fixed number of trades into each bar. More...
 
struct  TimeClock
 A clock that buckets trades by wall-clock time (nanoseconds). More...
 
class  Twap
 Running time-weighted average price. More...
 
struct  VolumeClock
 A clock that buckets a fixed amount of traded volume into each bar. More...
 
class  Vwap
 Running volume-weighted average price. More...
 

Typedefs

using BarCallback = std::function< void(const Bar &)>
 Callback invoked with each completed bar.
 

Functions

auto cross_type_name (char cross_type) -> std::string_view
 A human-readable description of a cross type code.
 
auto make_imbalance_info (const NOIIMessage &msg) -> ImbalanceInfo
 Builds an ImbalanceInfo from a raw NOII message.
 
auto imbalance_direction_name (char direction) -> std::string_view
 A human-readable description of an imbalance direction code.
 
auto spread (const book::Bbo &bbo) -> double
 The bid-ask spread in price units, or NaN if either side is empty.
 
auto mid_price (const book::Bbo &bbo) -> double
 The mid price ((bid + ask) / 2), or NaN if either side is empty.
 
auto queue_imbalance (const book::Bbo &bbo) -> double
 Top-of-book queue imbalance in [-1, 1].
 
auto depth_at_level (const book::L3Book &book, book::Side side, std::size_t levels) -> std::uint64_t
 Total displayed shares within the best levels price levels of a side.
 
auto order_flow_imbalance (const book::Bbo &previous, const book::Bbo &current) -> double
 The order-flow imbalance between two consecutive BBO observations.
 

Typedef Documentation

◆ BarCallback

using itch::analytics::BarCallback = typedef std::function<void(const Bar&)>

Callback invoked with each completed bar.

Definition at line 36 of file bars.hpp.

Function Documentation

◆ cross_type_name()

auto itch::analytics::cross_type_name ( char  cross_type) -> std::string_view
inline

A human-readable description of a cross type code.

Parameters
cross_typeThe single-character cross type code (e.g. 'O', 'C', 'H', 'I').
Returns
A short description of cross_type, or "Unknown" if unrecognized.

Definition at line 51 of file auctions.hpp.

References itch::indicators::FrozenMap< KeyType, Size >::at_or().

◆ make_imbalance_info()

auto itch::analytics::make_imbalance_info ( const NOIIMessage msg) -> ImbalanceInfo
inline

Builds an ImbalanceInfo from a raw NOII message.

Parameters
msgThe raw NOII message to decode.
Returns
An ImbalanceInfo populated from msg's fields.

Definition at line 47 of file imbalance.hpp.

References itch::STOCK_LEN, itch::analytics::ImbalanceInfo::timestamp, and itch::to_string().

Referenced by itch::analytics::AuctionTracker::process().

◆ imbalance_direction_name()

auto itch::analytics::imbalance_direction_name ( char  direction) -> std::string_view
inline

A human-readable description of an imbalance direction code.

Parameters
directionThe single-character imbalance direction code (e.g. 'B', 'S', 'N').
Returns
A short description of direction, or "Unknown" if unrecognized.

Definition at line 67 of file imbalance.hpp.

References itch::indicators::FrozenMap< KeyType, Size >::at_or().

◆ spread()

auto itch::analytics::spread ( const book::Bbo bbo) -> double
inline

The bid-ask spread in price units, or NaN if either side is empty.

Parameters
bboThe best-bid-offer snapshot to compute the spread from.
Returns
ask_price - bid_price, or NaN if either side has no resting order.

Definition at line 23 of file microstructure.hpp.

◆ mid_price()

auto itch::analytics::mid_price ( const book::Bbo bbo) -> double
inline

The mid price ((bid + ask) / 2), or NaN if either side is empty.

Parameters
bboThe best-bid-offer snapshot to compute the mid price from.
Returns
The average of the bid and ask prices, or NaN if either side has no resting order.

Definition at line 35 of file microstructure.hpp.

◆ queue_imbalance()

auto itch::analytics::queue_imbalance ( const book::Bbo bbo) -> double
inline

Top-of-book queue imbalance in [-1, 1].

Positive values indicate more size resting on the bid than the offer (buy-side pressure); negative values the reverse. Returns NaN when there is no resting size at the top of either side.

Parameters
bboThe best-bid-offer snapshot to compute the queue imbalance from.
Returns
The normalized bid/ask size imbalance in [-1, 1], or NaN if both sides are empty.

Definition at line 51 of file microstructure.hpp.

◆ depth_at_level()

auto itch::analytics::depth_at_level ( const book::L3Book book,
book::Side  side,
std::size_t  levels 
) -> std::uint64_t
inline

Total displayed shares within the best levels price levels of a side.

Parameters
bookThe order book to query.
sideThe book side (bid or ask) to sum depth for.
levelsNumber of best price levels to include.
Returns
The total displayed shares across the requested levels.

Definition at line 67 of file microstructure.hpp.

References side.

◆ order_flow_imbalance()

auto itch::analytics::order_flow_imbalance ( const book::Bbo previous,
const book::Bbo current 
) -> double
inline

The order-flow imbalance between two consecutive BBO observations.

Implements the standard order-flow-imbalance contribution of Cont, Kukanov and Stoikov: each side compares the new best price and size against the previous to attribute added or removed liquidity, and the offer contribution is subtracted from the bid contribution. Positive values indicate net buy-side flow.

Parameters
previousThe prior best-bid-offer snapshot.
currentThe current best-bid-offer snapshot.
Returns
The signed order-flow-imbalance contribution between the two snapshots.

Definition at line 87 of file microstructure.hpp.