dxFeed Graal Native SDK 3.16.0-rc1
Loading...
Searching...
No Matches
PriceLevelChecker' functions

The checker of the consistency of a list of orders. More...

Functions

int32_t dxfg_PriceLevelChecker_validate (graal_isolatethread_t *thread, dxfg_event_type_list *orders, int64_t timeGapBound, int32_t printQuotes, DXFG_OUT int32_t *isValid)
 Checks the consistency of a list of orders.

Detailed Description

The checker of the consistency of a list of orders.

Function Documentation

◆ dxfg_PriceLevelChecker_validate()

int32_t dxfg_PriceLevelChecker_validate ( graal_isolatethread_t * thread,
dxfg_event_type_list * orders,
int64_t timeGapBound,
int32_t printQuotes,
DXFG_OUT int32_t * isValid )

Checks the consistency of a list of orders.

PriceLevelChecker is a utility to check that in each moment of time the bid price of the orders is lower than the ask price. The check goes through the orders in the order of the list, so pass a list that is sorted by time, as dxfg_PriceLevelService_getOrders() returns it. Besides the result, the check reports to the Java log (not to the caller) the additional information:

  • a gap between two subsequent orders that is greater than timeGapBound;
  • the last bid and ask, changed with the minimal period of 1 second, when printQuotes is enabled;
  • a spike in the quotes, when printQuotes is enabled.

The orders are not valid if the check finds a crossing of the bid and ask prices, or if the greatest gap between two subsequent orders is greater than timeGapBound. A list without orders is valid. Note that in some cases it is normal when the bid is greater than or equal to the ask.

Java: PriceLevelChecker.validate(List, long, boolean).

Deprecated
Use dxfg_v4_PriceLevelChecker_validate().
Parameters
[in]threadThe current GraalVM Isolate's thread.
[in]ordersThe list of the orders (events that are orders, for example the list that dxfg_PriceLevelService_getOrders() returned); the call fails for another kind of event. The caller keeps its ownership.
[in]timeGapBoundThe greatest allowed gap between the times of two subsequent orders, in milliseconds (the unit of the time of an order).
[in]printQuotesNon-zero to log the quotes during the check, 0 not to.
[out]isValidSet to 1 if the orders are valid, 0 otherwise.
Returns
DXFG_EXECUTE_SUCCESSFULLY (0) on successful function execution or DXFG_EXECUTE_FAIL (-1) on error. Use dxfg_get_and_clear_thread_exception_t() to determine if an exception was thrown.