BetaTrader
A HFT Eco-System
Loading...
Searching...
No Matches
orderbook::OrderBook Class Reference

A client-side representation of the exchange's order book. More...

#include <OrderBook.h>

Collaboration diagram for orderbook::OrderBook:
Collaboration graph

Classes

struct  Snapshot
 

Public Member Functions

 OrderBook (const std::string &symbol)
 
 ~OrderBook ()=default
 
const std::string & getSymbol () const
 
Snapshot getUISnapshot (size_t maxDepth=10) const
 
void handleIncremental (const fix::MarketDataIncrementalRefresh &refresh)
 
void handleSnapshot (const fix::MarketDataSnapshotFullRefresh &snapshot)
 

Private Member Functions

void updateLevel (char type, double price, uint64_t qty, char action)
 

Private Attributes

std::map< double, uint64_t, std::less< double > > mAsks
 
std::map< double, uint64_t, std::greater< double > > mBids
 
std::mutex mMutex
 
std::string mSymbol
 

Detailed Description

A client-side representation of the exchange's order book.

Maintains a sorted Bid/Ask ladder using snapshots and incremental updates.

Constructor & Destructor Documentation

◆ OrderBook()

orderbook::OrderBook::OrderBook ( const std::string &  symbol)

◆ ~OrderBook()

orderbook::OrderBook::~OrderBook ( )
default

Member Function Documentation

◆ getSymbol()

const std::string & orderbook::OrderBook::getSymbol ( ) const
inline

◆ getUISnapshot()

OrderBook::Snapshot orderbook::OrderBook::getUISnapshot ( size_t  maxDepth = 10) const
Here is the caller graph for this function:

◆ handleIncremental()

void orderbook::OrderBook::handleIncremental ( const fix::MarketDataIncrementalRefresh refresh)
Here is the call graph for this function:

◆ handleSnapshot()

void orderbook::OrderBook::handleSnapshot ( const fix::MarketDataSnapshotFullRefresh snapshot)

◆ updateLevel()

void orderbook::OrderBook::updateLevel ( char  type,
double  price,
uint64_t  qty,
char  action 
)
private
Here is the caller graph for this function:

Member Data Documentation

◆ mAsks

std::map<double, uint64_t, std::less<double> > orderbook::OrderBook::mAsks
private

◆ mBids

std::map<double, uint64_t, std::greater<double> > orderbook::OrderBook::mBids
private

◆ mMutex

std::mutex orderbook::OrderBook::mMutex
mutableprivate

◆ mSymbol

std::string orderbook::OrderBook::mSymbol
private

The documentation for this class was generated from the following files: