The Orderbook Project is a C++ application simulating a financial order book. It manages buy and sell orders, matches them according to their prices, and keeps track of trades. The application supports two types of orders: Good Till Cancel (GTC) and Fill and Kill (FOK).
- Order Management: Add, modify, and cancel orders.
- Order Matching: Matches buy and sell orders based on price.
- Trade Execution: Executes trades and updates order quantities.
- Order Types: Supports Good Till Cancel (GTC) and Fill and Kill (FOK) orders.
- Orderbook Levels: Retrieves bid and ask levels with their respective quantities.
include/Order.h
: Header file for theOrder
class and related enums and type definitions.include/Orderbook.h
: Header file for theOrderbook
class and related type definitions.include/Trade.h
: Header file for theTrade
class and related structures.src/Order.cpp
: Implementation ofOrder
class methods.src/Orderbook.cpp
: Implementation ofOrderbook
class methods.src/Trade.cpp
: Implementation ofTrade
class methods.main.cpp
: Main entry point for the application.
- C++20 compatible compiler (e.g., g++, clang++)
- CMake (if using CMake for building the project)
- Clone the repository
mkdir build cd build
cmake .. make
./OrderbookProject
Alternatively, you can compile the project using g++:
g++ -std=c++20 -Iinclude src/Order.cpp src/Trade.cpp src/Orderbook.cpp main.cpp -o orderbook ./orderbook