### Functions starting with 'i' Source: https://chronoxor.github.io/CppTrader/functions_func.html Functions for checking various order and level properties, and initializing the ITCH handler. ```APIDOC ## IsAON() ### Description Checks if an order is All-Or-None (AON). ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## IsAsk() ### Description Checks if a level represents an ask. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## IsBid() ### Description Checks if a level represents a bid. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## IsBuy() ### Description Checks if an order is a buy order. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## IsFOK() ### Description Checks if an order is Fill-Or-Kill (FOK). ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## IsGTC() ### Description Checks if an order is Good-Til-Canceled (GTC). ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## IsHidden() ### Description Checks if an order is hidden. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## IsIceberg() ### Description Checks if an order is an iceberg order. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## IsIOC() ### Description Checks if an order is Immediate-Or-Cancel (IOC). ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## IsLimit() ### Description Checks if an order is a limit order. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## IsMarket() ### Description Checks if an order is a market order. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## IsMatchingEnabled() ### Description Checks if the matching engine is enabled in the market manager. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## IsSell() ### Description Checks if an order is a sell order. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## IsSlippage() ### Description Checks if an order has slippage protection. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## IsStop() ### Description Checks if an order is a stop order. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## IsStopLimit() ### Description Checks if an order is a stop limit order. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## IsTrailingStop() ### Description Checks if an order is a trailing stop order. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## IsTrailingStopLimit() ### Description Checks if an order is a trailing stop limit order. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## ITCHHandler() ### Description Constructor for the ITCHHandler class. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ``` -------------------------------- ### Functions starting with 'm' Source: https://chronoxor.github.io/CppTrader/functions_func.html Constructors for Market, MarketHandler, MarketManager, and functions for matching, mitigating, and modifying orders. ```APIDOC ## Market() ### Description Constructor for the Market class. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## MarketHandler() ### Description Constructor for the MarketHandler class. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## MarketManager() ### Description Constructor for the MarketManager class. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## Match() ### Description Initiates a matching process in the market manager. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## MitigateOrder() ### Description Mitigates an order in the market manager. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## ModifyOrder() ### Description Modifies an existing order in the market manager. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ``` -------------------------------- ### Get Market Price Ask - C++ Source: https://chronoxor.github.io/CppTrader/order__book_8inl_source.html Retrieves the best ask price considering both the matching ask price and the best available ask. Returns the minimum of the two. ```cpp inline uint64_t OrderBook::GetMarketPriceAsk() const noexcept { uint64_t matching_price = _matching_ask_price; uint64_t best_price = (_best_ask != nullptr) ? _best_ask->Price : std::numeric_limits::max(); return std::min(matching_price, best_price); } ``` -------------------------------- ### Order Creation Methods Source: https://chronoxor.github.io/CppTrader/struct_cpp_trader_1_1_matching_1_1_order.html Static methods to prepare and create different types of orders. ```APIDOC ## ◆ Limit() | Order CppTrader::Matching::Order::Limit | ( | uint64_t | _id_ , ---|---|---|--- | | uint32_t | _symbol_ , | | OrderSide | _side_ , | | uint64_t | _price_ , | | uint64_t | _quantity_ , | | OrderTimeInForce | _tif_ = OrderTimeInForce::GTC, | | uint64_t | _max_visible_quantity_ = std::numeric_limits::max() ) inlinestaticnoexcept Prepare a new limit order. Definition at line 143 of file order.inl. ``` ```APIDOC ## ◆ Market() | Order CppTrader::Matching::Order::Market | ( | uint64_t | _id_ , ---|---|---|--- | | uint32_t | _symbol_ , | | OrderSide | _side_ , | | uint64_t | _quantity_ , | | uint64_t | _slippage_ = std::numeric_limits::max() ) inlinestaticnoexcept Prepare a new market order. Definition at line 128 of file order.inl. ``` ```APIDOC ## ◆ SellLimit() | Order CppTrader::Matching::Order::SellLimit | ( | uint64_t | _id_ , ---|---|---|--- | | uint32_t | _symbol_ , | | uint64_t | _price_ , | | uint64_t | _quantity_ , | | OrderTimeInForce | _tif_ = OrderTimeInForce::GTC, | | uint64_t | _max_visible_quantity_ = std::numeric_limits::max() ) inlinestaticnoexcept Prepare a new sell limit order. Examples matching_engine.cpp. Definition at line 153 of file order.inl. ``` ```APIDOC ## ◆ SellMarket() | Order CppTrader::Matching::Order::SellMarket | ( | uint64_t | _id_ , ---|---|---|--- | | uint32_t | _symbol_ , | | uint64_t | _quantity_ , | | uint64_t | _slippage_ = std::numeric_limits::max() ) inlinestaticnoexcept Prepare a new sell market order. Examples matching_engine.cpp. Definition at line 138 of file order.inl. ``` ```APIDOC ## ◆ SellStop() | Order CppTrader::Matching::Order::SellStop | ( | uint64_t | _id_ , ---|---|---|--- | | uint32_t | _symbol_ , | | uint64_t | _stop_price_ , | | uint64_t | _quantity_ , | | OrderTimeInForce | _tif_ = OrderTimeInForce::GTC, | | uint64_t | _slippage_ = std::numeric_limits::max() ) inlinestaticnoexcept Prepare a new sell stop order. Examples matching_engine.cpp. Definition at line 168 of file order.inl. ``` -------------------------------- ### Functions starting with 'f' Source: https://chronoxor.github.io/CppTrader/functions_func.html A hashing function. ```APIDOC ## FastHash() ### Description Computes a fast hash value. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ``` -------------------------------- ### Functions starting with 'h' Source: https://chronoxor.github.io/CppTrader/functions_func.html Functions related to order properties. ```APIDOC ## HiddenQuantity() ### Description Gets the hidden quantity of an order. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ``` -------------------------------- ### Order Constructor Source: https://chronoxor.github.io/CppTrader/order_8inl_source.html Initializes an Order object with all relevant trading parameters. Sets initial quantities and other properties. ```cpp inline Order::Order(uint64_t id, uint32_t symbol, OrderType type, OrderSide side, uint64_t price, uint64_t stop_price, uint64_t quantity, OrderTimeInForce tif, uint64_t max_visible_quantity, uint64_t slippage, int64_t trailing_distance, int64_t trailing_step) noexcept : Id(id), SymbolId(symbol), Type(type), Side(side), Price(price), StopPrice(stop_price), Quantity(quantity), ExecutedQuantity(0), LeavesQuantity(quantity), TimeInForce(tif), MaxVisibleQuantity(max_visible_quantity), Slippage(slippage), TrailingDistance(trailing_distance), TrailingStep(trailing_step) { } ``` -------------------------------- ### Main Function - Command Input Loop Source: https://chronoxor.github.io/CppTrader/matching_engine_8cpp-example.html The main function initializes the market handler and manager, then enters a loop to read commands from standard input. It supports various commands for managing symbols, order books, and orders. ```cpp int main(int argc, char** argv) { MyMarketHandler market_handler; MarketManager market(market_handler); // Perform text input std::string line; while (getline(std::cin, line)) { if (line == "help") { std::cout << "Supported commands: " << std::endl; std::cout << "add symbol {Id} {Name} - Add a new symbol with {Id} and {Name}" << std::endl; std::cout << "delete symbol {Id} - Delete the symbol with {Id}" << std::endl; std::cout << "add book {Id} - Add a new order book for the symbol with {Id}" << std::endl; std::cout << "delete book {Id} - Delete the order book with {Id}" << std::endl; std::cout << "add market {Side} {Id} {SymbolId} {Quantity} - Add a new market order of {Type} (buy/sell) with {Id}, {SymbolId} and {Quantity}" << std::endl; std::cout << "add slippage market {Side} {Id} {SymbolId} {Quantity} {Slippage} - Add a new slippage market order of {Type} (buy/sell) with {Id}, {SymbolId}, {Quantity} and {Slippage}" << std::endl; std::cout << "add limit {Side} {Id} {SymbolId} {Price} {Quantity} - Add a new limit order of {Type} (buy/sell) with {Id}, {SymbolId}, {Price} and {Quantity}" << std::endl; std::cout << "add ioc limit {Side} {Id} {SymbolId} {Price} {Quantity} - Add a new 'Immediate-Or-Cancel' limit order of {Type} (buy/sell) with {Id}, {SymbolId}, {Price} and {Quantity}" << std::endl; std::cout << "add fok limit {Side} {Id} {SymbolId} {Price} {Quantity} - Add a new 'Fill-Or-Kill' limit order of {Type} (buy/sell) with {Id}, {SymbolId}, {Price} and {Quantity}" << std::endl; } } } ``` -------------------------------- ### Get Bids Source: https://chronoxor.github.io/CppTrader/order__book_8h_source.html Retrieves the container for all bid orders in the order book. ```APIDOC ## bids ### Description Get the order book bids container. ### Method const Levels & bids() const noexcept ### Definition order_book.h:62 ``` -------------------------------- ### Functions starting with 'a' Source: https://chronoxor.github.io/CppTrader/functions_func.html Functions for managing orders and order books, and adding symbols. ```APIDOC ## AddOrder() ### Description Adds an order to the market manager. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## AddOrderBook() ### Description Adds an order book to the market manager. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## AddSymbol() ### Description Adds a symbol to the market manager. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## asks() ### Description Retrieves the asks from an order book. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ``` -------------------------------- ### OrderBook Constructor Source: https://chronoxor.github.io/CppTrader/order__book_8cpp_source.html Initializes the OrderBook with a reference to the MarketManager and the trading symbol. It sets up various price level pointers and initial price values. ```cpp #include "trader/matching/market_manager.h" #include "trader/matching/order_book.h" namespace CppTrader { namespace Matching { OrderBook::OrderBook(MarketManager& manager, const Symbol& symbol) : _manager(manager), _symbol(symbol), _best_bid(nullptr), _best_ask(nullptr), _best_buy_stop(nullptr), _best_sell_stop(nullptr), _best_trailing_buy_stop(nullptr), _best_trailing_sell_stop(nullptr), _last_bid_price(0), _last_ask_price(std::numeric_limits::max()), _matching_bid_price(0), _matching_ask_price(std::numeric_limits::max()), _trailing_bid_price(0), _trailing_ask_price(std::numeric_limits::max()) { } ``` -------------------------------- ### Get Sell Stop Orders Source: https://chronoxor.github.io/CppTrader/order__book_8h_source.html Retrieves the container for all sell stop orders. ```APIDOC ## sell_stop ### Description Get the order book sell stop orders container. ### Method const Levels & sell_stop() const noexcept ### Definition order_book.h:74 ``` -------------------------------- ### Order Creation Methods Source: https://chronoxor.github.io/CppTrader/struct_cpp_trader_1_1_matching_1_1_order.html Static methods for creating different types of orders. ```APIDOC ## Member Function Documentation ### ◆ BuyLimit() Prepare a new buy limit order. ```cpp Order CppTrader::Matching::Order::BuyLimit(uint64_t _id_, uint32_t _symbol_, uint64_t _price_, uint64_t _quantity_, OrderTimeInForce _tif_ = OrderTimeInForce::GTC, uint64_t _max_visible_quantity_ = std::numeric_limits::max()) ``` ### ◆ BuyMarket() Prepare a new buy market order. ```cpp Order CppTrader::Matching::Order::BuyMarket(uint64_t _id_, uint32_t _symbol_, uint64_t _quantity_, uint64_t _slippage_ = std::numeric_limits::max()) ``` ### ◆ BuyStop() Prepare a new buy stop order. ```cpp Order CppTrader::Matching::Order::BuyStop(uint64_t _id_, uint32_t _symbol_, uint64_t _stop_price_, uint64_t _quantity_, OrderTimeInForce _tif_ = OrderTimeInForce::GTC, uint64_t _slippage_ = std::numeric_limits::max()) ``` ### ◆ BuyStopLimit() Prepare a new buy stop-limit order. ```cpp Order CppTrader::Matching::Order::BuyStopLimit(uint64_t _id_, uint32_t _symbol_, uint64_t _stop_price_, uint64_t _price_, uint64_t _quantity_, OrderTimeInForce _tif_ = OrderTimeInForce::GTC, uint64_t _max_visible_quantity_ = std::numeric_limits::max()) ``` ``` -------------------------------- ### Order::TrailingBuyStop Source: https://chronoxor.github.io/CppTrader/matching_engine_8cpp-example.html Prepares a new trailing buy stop order. ```APIDOC ## TrailingBuyStop ### Description Prepare a new trailing buy stop order. ### Method `static Order TrailingBuyStop(uint64_t id, uint32_t symbol, uint64_t stop_price, uint64_t quantity, int64_t trailing_distance, int64_t trailing_step=0, OrderTimeInForce tif=OrderTimeInForce::GTC, uint64_t slippage=std::numeric_limits< uint64_t >::max()) noexcept` ### Parameters #### Path Parameters - **id** (uint64_t) - Required - The unique identifier for the order. - **symbol** (uint32_t) - Required - The symbol identifier. - **stop_price** (uint64_t) - Required - The initial stop price. - **quantity** (uint64_t) - Required - The quantity of the order. - **trailing_distance** (int64_t) - Required - The distance to trail the stop price. - **trailing_step** (int64_t) - Optional - The step size for trailing the stop price (default: 0). - **tif** (OrderTimeInForce) - Optional - Time in force for the order (default: GTC). - **slippage** (uint64_t) - Optional - The maximum acceptable slippage for the order (default: max uint64_t). ``` -------------------------------- ### Get Buy Stop Orders Source: https://chronoxor.github.io/CppTrader/order__book_8h_source.html Retrieves the container for all buy stop orders. ```APIDOC ## buy_stop ### Description Get the order book buy stop orders container. ### Method const Levels & buy_stop() const noexcept ### Definition order_book.h:72 ``` -------------------------------- ### Static Order Creation Methods Source: https://chronoxor.github.io/CppTrader/struct_cpp_trader_1_1_matching_1_1_order-members.html Static methods for creating specific types of orders. ```APIDOC ## BuyLimit(uint64_t id, uint32_t symbol, uint64_t price, uint64_t quantity, OrderTimeInForce tif = OrderTimeInForce::GTC, uint64_t max_visible_quantity = std::numeric_limits< uint64_t >::max()) noexcept ### Description Creates a buy limit order. ### Method BuyLimit(uint64_t id, uint32_t symbol, uint64_t price, uint64_t quantity, OrderTimeInForce tif, uint64_t max_visible_quantity) ### Parameters - **id** (uint64_t) - Unique identifier for the order. - **symbol** (uint32_t) - Symbol identifier for the traded asset. - **price** (uint64_t) - Limit price for the order. - **quantity** (uint64_t) - Quantity of the asset to trade. - **tif** (OrderTimeInForce) - Time in force for the order (default: GTC). - **max_visible_quantity** (uint64_t) - Maximum quantity to be visible in the order book (default: max uint64_t). ### Response Example ```json { "example": "Buy limit order created successfully." } ``` ``` ```APIDOC ## BuyMarket(uint64_t id, uint32_t symbol, uint64_t quantity, uint64_t slippage = std::numeric_limits< uint64_t >::max()) noexcept ### Description Creates a buy market order. ### Method BuyMarket(uint64_t id, uint32_t symbol, uint64_t quantity, uint64_t slippage) ### Parameters - **id** (uint64_t) - Unique identifier for the order. - **symbol** (uint32_t) - Symbol identifier for the traded asset. - **quantity** (uint64_t) - Quantity of the asset to trade. - **slippage** (uint64_t) - Allowed slippage for the market order (default: max uint64_t). ### Response Example ```json { "example": "Buy market order created successfully." } ``` ``` ```APIDOC ## BuyStop(uint64_t id, uint32_t symbol, uint64_t stop_price, uint64_t quantity, OrderTimeInForce tif = OrderTimeInForce::GTC, uint64_t slippage = std::numeric_limits< uint64_t >::max()) noexcept ### Description Creates a buy stop order. ### Method BuyStop(uint64_t id, uint32_t symbol, uint64_t stop_price, uint64_t quantity, OrderTimeInForce tif, uint64_t slippage) ### Parameters - **id** (uint64_t) - Unique identifier for the order. - **symbol** (uint32_t) - Symbol identifier for the traded asset. - **stop_price** (uint64_t) - Stop price for the order. - **quantity** (uint64_t) - Quantity of the asset to trade. - **tif** (OrderTimeInForce) - Time in force for the order (default: GTC). - **slippage** (uint64_t) - Allowed slippage for the stop order (default: max uint64_t). ### Response Example ```json { "example": "Buy stop order created successfully." } ``` ``` ```APIDOC ## BuyStopLimit(uint64_t id, uint32_t symbol, uint64_t stop_price, uint64_t price, uint64_t quantity, OrderTimeInForce tif = OrderTimeInForce::GTC, uint64_t max_visible_quantity = std::numeric_limits< uint64_t >::max()) noexcept ### Description Creates a buy stop limit order. ### Method BuyStopLimit(uint64_t id, uint32_t symbol, uint64_t stop_price, uint64_t price, uint64_t quantity, OrderTimeInForce tif, uint64_t max_visible_quantity) ### Parameters - **id** (uint64_t) - Unique identifier for the order. - **symbol** (uint32_t) - Symbol identifier for the traded asset. - **stop_price** (uint64_t) - Stop price for the order. - **price** (uint64_t) - Limit price for the order. - **quantity** (uint64_t) - Quantity of the asset to trade. - **tif** (OrderTimeInForce) - Time in force for the order (default: GTC). - **max_visible_quantity** (uint64_t) - Maximum quantity to be visible in the order book (default: max uint64_t). ### Response Example ```json { "example": "Buy stop limit order created successfully." } ``` ``` ```APIDOC ## Limit(uint64_t id, uint32_t symbol, OrderSide side, uint64_t price, uint64_t quantity, OrderTimeInForce tif = OrderTimeInForce::GTC, uint64_t max_visible_quantity = std::numeric_limits< uint64_t >::max()) noexcept ### Description Creates a generic limit order. ### Method Limit(uint64_t id, uint32_t symbol, OrderSide side, uint64_t price, uint64_t quantity, OrderTimeInForce tif, uint64_t max_visible_quantity) ### Parameters - **id** (uint64_t) - Unique identifier for the order. - **symbol** (uint32_t) - Symbol identifier for the traded asset. - **side** (OrderSide) - Side of the order (Buy or Sell). - **price** (uint64_t) - Limit price for the order. - **quantity** (uint64_t) - Quantity of the asset to trade. - **tif** (OrderTimeInForce) - Time in force for the order (default: GTC). - **max_visible_quantity** (uint64_t) - Maximum quantity to be visible in the order book (default: max uint64_t). ### Response Example ```json { "example": "Limit order created successfully." } ``` ``` ```APIDOC ## Market(uint64_t id, uint32_t symbol, OrderSide side, uint64_t quantity, uint64_t slippage = std::numeric_limits< uint64_t >::max()) noexcept ### Description Creates a generic market order. ### Method Market(uint64_t id, uint32_t symbol, OrderSide side, uint64_t quantity, uint64_t slippage) ### Parameters - **id** (uint64_t) - Unique identifier for the order. - **symbol** (uint32_t) - Symbol identifier for the traded asset. - **side** (OrderSide) - Side of the order (Buy or Sell). - **quantity** (uint64_t) - Quantity of the asset to trade. - **slippage** (uint64_t) - Allowed slippage for the market order (default: max uint64_t). ### Response Example ```json { "example": "Market order created successfully." } ``` ``` -------------------------------- ### Functions starting with 'l' Source: https://chronoxor.github.io/CppTrader/functions_func.html Constructors for Level, LevelNode, and LevelUpdate, and creation of Limit orders. ```APIDOC ## Level() ### Description Constructor for the Level class. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## LevelNode() ### Description Constructor for the LevelNode class. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## LevelUpdate() ### Description Constructor for the LevelUpdate class. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## Limit() ### Description Creates a limit order. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ``` -------------------------------- ### Order::TrailingBuyStopLimit Source: https://chronoxor.github.io/CppTrader/matching_engine_8cpp-example.html Prepares a new trailing buy stop-limit order. ```APIDOC ## TrailingBuyStopLimit ### Description Prepare a new trailing buy stop-limit order. ### Method `static Order TrailingBuyStopLimit(uint64_t id, uint32_t symbol, uint64_t stop_price, uint64_t price, uint64_t quantity, int64_t trailing_distance, int64_t trailing_step=0, OrderTimeInForce tif=OrderTimeInForce::GTC, uint64_t max_visible_quantity=std::numeric_limits< uint64_t >::max()) noexcept` ### Parameters #### Path Parameters - **id** (uint64_t) - Required - The unique identifier for the order. - **symbol** (uint32_t) - Required - The symbol identifier. - **stop_price** (uint64_t) - Required - The initial stop price. - **price** (uint64_t) - Required - The limit price for the order. - **quantity** (uint64_t) - Required - The quantity of the order. - **trailing_distance** (int64_t) - Required - The distance to trail the stop price. - **trailing_step** (int64_t) - Optional - The step size for trailing the stop price (default: 0). - **tif** (OrderTimeInForce) - Optional - Time in force for the order (default: GTC). - **max_visible_quantity** (uint64_t) - Optional - Maximum visible quantity for the order (default: max uint64_t). ``` -------------------------------- ### Functions starting with 'e' Source: https://chronoxor.github.io/CppTrader/functions_func.html Functions for checking if an order book is empty and enabling/executing orders. ```APIDOC ## empty() ### Description Checks if an order book is empty. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## EnableMatching() ### Description Enables the matching engine in the market manager. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## ExecuteOrder() ### Description Executes an order through the market manager. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ``` -------------------------------- ### Order Creation Functions Source: https://chronoxor.github.io/CppTrader/order_8h_source.html Static factory methods for creating different types of orders. ```APIDOC ## Order Creation Functions This section details the static factory methods available for creating various order types. ### `Order::SellLimit` Prepare a new sell limit order. **Parameters** - `id` (uint64_t) - Order identifier. - `symbol` (uint32_t) - Symbol identifier. - `price` (uint64_t) - Limit price. - `quantity` (uint64_t) - Order quantity. - `tif` (OrderTimeInForce, optional) - Time in force, defaults to `OrderTimeInForce::GTC`. - `max_visible_quantity` (uint64_t, optional) - Maximum visible quantity, defaults to `std::numeric_limits::max()`. ### `Order::BuyStopLimit` Prepare a new buy stop-limit order. **Parameters** - `id` (uint64_t) - Order identifier. - `symbol` (uint32_t) - Symbol identifier. - `stop_price` (uint64_t) - Stop price. - `price` (uint64_t) - Limit price. - `quantity` (uint64_t) - Order quantity. - `tif` (OrderTimeInForce, optional) - Time in force, defaults to `OrderTimeInForce::GTC`. - `max_visible_quantity` (uint64_t, optional) - Maximum visible quantity, defaults to `std::numeric_limits::max()`. ### `Order::BuyMarket` Prepare a new buy market order. **Parameters** - `id` (uint64_t) - Order identifier. - `symbol` (uint32_t) - Symbol identifier. - `quantity` (uint64_t) - Order quantity. - `slippage` (uint64_t, optional) - Maximum slippage, defaults to `std::numeric_limits::max()`. ### `Order::TrailingBuyStop` Prepare a new trailing buy stop order. **Parameters** - `id` (uint64_t) - Order identifier. - `symbol` (uint32_t) - Symbol identifier. - `stop_price` (uint64_t) - Stop price. - `quantity` (uint64_t) - Order quantity. - `trailing_distance` (int64_t) - Trailing distance. - `trailing_step` (int64_t, optional) - Trailing step, defaults to 0. - `tif` (OrderTimeInForce, optional) - Time in force, defaults to `OrderTimeInForce::GTC`. - `slippage` (uint64_t, optional) - Maximum slippage, defaults to `std::numeric_limits::max()`. ### `Order::Stop` Prepare a new stop order. **Parameters** - `id` (uint64_t) - Order identifier. - `symbol` (uint32_t) - Symbol identifier. - `side` (OrderSide) - Order side (BUY or SELL). - `stop_price` (uint64_t) - Stop price. - `quantity` (uint64_t) - Order quantity. - `tif` (OrderTimeInForce, optional) - Time in force, defaults to `OrderTimeInForce::GTC`. - `slippage` (uint64_t, optional) - Maximum slippage, defaults to `std::numeric_limits::max()`. ``` -------------------------------- ### Get Buy Stop Level Source: https://chronoxor.github.io/CppTrader/order__book_8h_source.html Retrieves the buy stop level for a specific price. ```APIDOC ## GetBuyStopLevel ### Description Get the order book buy stop level with the given price. ### Method const LevelNode * GetBuyStopLevel(uint64_t price) const noexcept ### Definition order_book.inl:38 ``` -------------------------------- ### Get Best Bid Source: https://chronoxor.github.io/CppTrader/order__book_8h_source.html Retrieves the price level node for the best bid order. ```APIDOC ## best_bid ### Description Get the order book best bid price level. ### Method const LevelNode * best_bid() const noexcept ### Definition order_book.h:57 ``` -------------------------------- ### Market Orders Source: https://chronoxor.github.io/CppTrader/struct_cpp_trader_1_1_matching_1_1_order_node.html Static methods to prepare new market orders. ```APIDOC ## Market ### Description Prepare a new market order. ### Signature `static Order | Market(uint64_t id, uint32_t symbol, OrderSide side, uint64_t quantity, uint64_t slippage = std::numeric_limits< uint64_t >::max()) noexcept` ## BuyMarket ### Description Prepare a new buy market order. ### Signature `static Order | BuyMarket(uint64_t id, uint32_t symbol, uint64_t quantity, uint64_t slippage = std::numeric_limits< uint64_t >::max()) noexcept` ## SellMarket ### Description Prepare a new sell market order. ### Signature `static Order | SellMarket(uint64_t id, uint32_t symbol, uint64_t quantity, uint64_t slippage = std::numeric_limits< uint64_t >::max()) noexcept` ``` -------------------------------- ### Market Data Processing with MarketManager Source: https://chronoxor.github.io/CppTrader/market_manager_8cpp-example.html This C++ code snippet demonstrates the main function for processing market data. It initializes a MarketManager and an ITCHHandler, then reads data from standard input and processes it using the ITCHHandler. Ensure that MyMarketHandler and MyITCHHandler are correctly implemented and available. ```cpp int main(int argc, char** argv) { MyMarketHandler market_handler; MarketManager market(market_handler); MyITCHHandler itch_handler(market); // Perform input size_t size; uint8_t buffer[8192]; CppCommon::StdInput input; while ((size = input.Read(buffer, sizeof(buffer))) > 0) { // Process the buffer itch_handler.Process(buffer, size); } return 0; } ``` -------------------------------- ### Functions starting with 'd' Source: https://chronoxor.github.io/CppTrader/functions_func.html Functions for deleting orders, order books, and symbols, and disabling matching. ```APIDOC ## DeleteOrder() ### Description Deletes an order from the market manager. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## DeleteOrderBook() ### Description Deletes an order book from the market manager. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## DeleteSymbol() ### Description Deletes a symbol from the market manager. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ## DisableMatching() ### Description Disables the matching engine in the market manager. ### Method Not specified (likely a C++ method call) ### Endpoint N/A ### Parameters None explicitly defined in source. ### Request Example N/A ### Response None explicitly defined in source. ``` -------------------------------- ### Main Function for ITCH Data Processing Source: https://chronoxor.github.io/CppTrader/itch_handler_8cpp-example.html This main function initializes the custom ITCH handler and reads binary data from standard input, processing it chunk by chunk. Ensure the input stream provides valid ITCH data. ```cpp int main(int argc, char** argv) { MyITCHHandler itch_handler; // Perform input size_t size; uint8_t buffer[8192]; CppCommon::StdInput input; while ((size = input.Read(buffer, sizeof(buffer))) > 0) { // Process the buffer itch_handler.Process(buffer, size); } return 0; } ``` -------------------------------- ### OrderBook::GetNextLevel Source: https://chronoxor.github.io/CppTrader/order__book_8inl_source.html Gets the next level node in the order book, either for bids or asks. ```APIDOC ## GetNextLevel OrderBook ### Description Gets the next level node in the order book, either for bids or asks, relative to the provided level. ### Method `LevelNode* GetNextLevel(LevelNode* level) noexcept` ### Parameters - **level** (LevelNode*) - A pointer to the current level node. ### Response Returns a pointer to the next `LevelNode` in the sequence, or `nullptr` if it's the last level. ### Example ```cpp LevelNode* current_bid = order_book.GetBid(10000); if (current_bid) { LevelNode* next_bid = order_book.GetNextLevel(current_bid); // Process next bid level } ``` ``` -------------------------------- ### Order Creation Functions Source: https://chronoxor.github.io/CppTrader/order_8h_source.html This section details the static factory methods available for creating different types of orders. ```APIDOC ## Order Creation This section provides details on the static methods used to create various order types. ### `Order::Market` Prepare a new market order. **Signature:** `static Order Market(uint64_t id, uint32_t symbol, OrderSide side, uint64_t quantity, uint64_t slippage = std::numeric_limits< uint64_t >::max()) noexcept` ### `Order::SellMarket` Prepare a new sell market order. **Signature:** `static Order SellMarket(uint64_t id, uint32_t symbol, uint64_t quantity, uint64_t slippage = std::numeric_limits< uint64_t >::max()) noexcept` ### `Order::Limit` Prepare a new limit order. **Signature:** `static Order Limit(uint64_t id, uint32_t symbol, OrderSide side, uint64_t price, uint64_t quantity, OrderTimeInForce tif = OrderTimeInForce::GTC, uint64_t max_visible_quantity = std::numeric_limits< uint64_t >::max()) noexcept` ### `Order::BuyLimit` Prepare a new buy limit order. **Signature:** `static Order BuyLimit(uint64_t id, uint32_t symbol, uint64_t price, uint64_t quantity, OrderTimeInForce tif = OrderTimeInForce::GTC, uint64_t max_visible_quantity = std::numeric_limits< uint64_t >::max()) noexcept` ### `Order::SellLimit` Prepare a new sell-limit order. **Signature:** `static Order SellLimit(uint64_t id, uint32_t symbol, uint64_t stop_price, uint64_t price, uint64_t quantity, OrderTimeInForce tif = OrderTimeInForce::GTC, uint64_t max_visible_quantity = std::numeric_limits< uint64_t >::max()) noexcept` ### `Order::StopLimit` Prepare a new stop-limit order. **Signature:** `static Order StopLimit(uint64_t id, uint32_t symbol, OrderSide side, uint64_t stop_price, uint64_t price, uint64_t quantity, OrderTimeInForce tif = OrderTimeInForce::GTC, uint64_t max_visible_quantity = std::numeric_limits< uint64_t >::max()) noexcept` ### `Order::SellStop` Prepare a new sell stop order. **Signature:** `static Order SellStop(uint64_t id, uint32_t symbol, uint64_t stop_price, uint64_t quantity, OrderTimeInForce tif = OrderTimeInForce::GTC, uint64_t slippage = std::numeric_limits< uint64_t >::max()) noexcept` ### `Order::TrailingStop` Prepare a new trailing stop order. **Signature:** `static Order TrailingStop(uint64_t id, uint32_t symbol, OrderSide side, uint64_t stop_price, uint64_t quantity, int64_t trailing_distance, int64_t trailing_step = 0, OrderTimeInForce tif = OrderTimeInForce::GTC, uint64_t slippage = std::numeric_limits< uint64_t >::max()) noexcept` ### `Order::TrailingStopLimit` Prepare a new trailing stop-limit order. **Signature:** `static Order TrailingStopLimit(uint64_t id, uint32_t symbol, OrderSide side, uint64_t stop_price, uint64_t price, uint64_t quantity, int64_t trailing_distance, int64_t trailing_step = 0, OrderTimeInForce tif = OrderTimeInForce::GTC, uint64_t max_visible_quantity = std::numeric_limits< uint64_t >::max()) noexcept` ### `Order::TrailingBuyStopLimit` Prepare a new trailing buy stop-limit order. **Signature:** `static Order TrailingBuyStopLimit(uint64_t id, uint32_t symbol, OrderSide side, uint64_t stop_price, uint64_t price, uint64_t quantity, int64_t trailing_distance, int64_t trailing_step = 0, OrderTimeInForce tif = OrderTimeInForce::GTC, uint64_t max_visible_quantity = std::numeric_limits< uint64_t >::max()) noexcept` ``` -------------------------------- ### TrailingBuyStop Source: https://chronoxor.github.io/CppTrader/struct_cpp_trader_1_1_matching_1_1_order.html Prepares a new trailing buy stop order with specified parameters including ID, symbol, stop price, quantity, trailing distance, trailing step, time-in-force, and slippage. ```APIDOC ## TrailingBuyStop() ### Description Prepare a new trailing buy stop order. ### Parameters - `_id_` (uint64_t) - Order identifier. - `_symbol_` (uint32_t) - Symbol identifier. - `_stop_price_` (uint64_t) - The price at which the stop order becomes active. - `_quantity_` (uint64_t) - The number of units to trade. - `_trailing_distance_` (int64_t) - The distance from the market price to set the stop. - `_trailing_step_` (int64_t) - The step size for adjusting the stop price, defaults to 0. - `_tif_` (OrderTimeInForce) - Time in force, defaults to GTC (Good 'Til Cancelled). - `_slippage_` (uint64_t) - Maximum acceptable slippage, defaults to maximum uint64_t value. ``` -------------------------------- ### Prepare Buy Market Order Source: https://chronoxor.github.io/CppTrader/order_8inl_source.html Static utility function to create a new buy market order. Allows specifying slippage, which defaults to the maximum possible value. ```cpp static Order BuyMarket(uint64_t id, uint32_t symbol, uint64_t quantity, uint64_t slippage=std::numeric_limits< uint64_t >::max()) noexcept ```