dxFeed Graal CXX API v9.0.0
Loading...
Searching...
No Matches
PriceLevelChecker Struct Referencefinal

Checks the consistency of a list of price levels (Order events) received from a PriceLevelService. More...

#include <PriceLevelChecker.hpp>

Static Public Member Functions

static bool validate (const std::vector< std::shared_ptr< Order > > &orders, std::chrono::milliseconds timeGapBound, bool printQuotes)
 Checks the consistency of the list of orders.

Detailed Description

Checks the consistency of a list of price levels (Order events) received from a PriceLevelService.

The list is not valid when:

  • the orders of one time cross the opposite side of the book (the bid price is not lower than the ask price); the orders of a time are checked when the orders of the next time begin, so the orders of the last time are not checked;
  • the longest gap between subsequent orders is longer than the gap bound.

The check logs the crosses and the gaps. With printQuotes it also logs the bid and ask with the minimal period of 1 second and the spikes in them.

Member Function Documentation

◆ validate()

DXFCPP_BEGIN_NAMESPACE bool PriceLevelChecker::validate ( const std::vector< std::shared_ptr< Order > > & orders,
std::chrono::milliseconds timeGapBound,
bool printQuotes )
static

Checks the consistency of the list of orders.

Parameters
ordersThe list of orders sorted by time (as PriceLevelService::getOrders() returns them).
timeGapBoundThe bound of the gap between subsequent orders.
printQuotestrue to log the bid and ask and their spikes during the check.
Returns
true if the orders are valid.