CBOE Emulator
1.0
|
Logic for maintaining a continuous double auction via a limit-order book. More...
Classes | |
struct | Limit |
A price limit containing a FIFO queue of Order objects. More... | |
class | LimitOrderBook |
An order book for managing Limit / Order objects in a continuous double auction. More... | |
struct | LimitTree |
A single side (buy/sell) of the LimitOrderBook. More... | |
struct | Order |
A single order in the LimitOrderBook. More... | |
Typedefs | |
typedef std::unordered_map< UID, Order > | UIDOrderMap |
a map of order IDs to orders | |
typedef tsl::robin_map< Price, Limit * > | PriceLimitMap |
a map of prices to limit pointers | |
typedef uint64_t | UID |
a type for order IDs | |
typedef uint32_t | Quantity |
a type for order quantities | |
typedef uint64_t | Price |
a type for order prices | |
typedef uint32_t | Count |
a type for limit price order counts | |
typedef uint64_t | Volume |
a type for limit total volume | |
Enumerations | |
enum | Side : bool { Sell = false, Buy = true } |
the possible sides for the LimitTree | |
Functions | |
template<Side side> | |
void | set_best (Limit **best, Limit *limit) |
Set the best to the given limit if the given limit is better. More... | |
template<> | |
void | set_best< Side::Buy > (Limit **highest_buy, Limit *limit) |
Set the best buy to the given limit if the given limit is better. More... | |
template<> | |
void | set_best< Side::Sell > (Limit **lowest_sell, Limit *limit) |
Set the best sell to the given limit if the given limit is better. More... | |
template<Side side> | |
void | find_best (Limit **best) |
Find the next best when removing the best from the tree. More... | |
template<> | |
void | find_best< Side::Buy > (Limit **highest_buy) |
Find the next buy when removing the best buy from the tree. More... | |
template<> | |
void | find_best< Side::Sell > (Limit **lowest_sell) |
Find the next sell when removing the best sell from the tree. More... | |
template<Side side> | |
bool | can_match (Price limit, Price market) |
Return true if the market price can match with the limit price. More... | |
template<> | |
bool | can_match< Side::Buy > (Price limit, Price market) |
Return true if the sell market price can match with the buy limit price. More... | |
template<> | |
bool | can_match< Side::Sell > (Price limit, Price market) |
Return true if the buy market price can match with the sell limit price. More... | |
Side | operator! (Side side) |
Return the opposite side using the invert operator. More... | |
Logic for maintaining a continuous double auction via a limit-order book.
Return true if the market price can match with the limit price.
side | the side of the book to perform the calculation from |
limit | the price of the limit order (i.e., the best price) |
market | the price of the opposing side market order to compare |
|
inline |
Return true if the sell market price can match with the buy limit price.
limit | the price of the buy limit order (i.e., the best price) |
market | the price of the sell side market order to compare |
|
inline |
Return true if the buy market price can match with the sell limit price.
limit | the price of the sell limit order (i.e., the best price) |
market | the price of the buy side market order to compare |
void DataFeed::LOB::find_best | ( | Limit ** | best | ) |
Find the next best when removing the best from the tree.
side | the side of the book to perform the calculation from |
best | the best limit node |
|
inline |
Find the next buy when removing the best buy from the tree.
highest_buy | the best buy limit node |
|
inline |
Find the next sell when removing the best sell from the tree.
lowest_sell | the best sell limit node |
Return the opposite side using the invert operator.
side | the side to invert |
Set the best to the given limit if the given limit is better.
side | the side of the book to perform the calculation from |
best | the current best limit |
limit | the limit node to compare to |
|
inline |
Set the best buy to the given limit if the given limit is better.
highest_buy | the current best buy limit |
limit | the buy limit node to compare to |
|
inline |
Set the best sell to the given limit if the given limit is better.
lowest_sell | the current best sell limit |
limit | the sell limit node to compare to |