Skip to content

Latest commit

Β 

History

History
37 lines (26 loc) Β· 1.1 KB

File metadata and controls

37 lines (26 loc) Β· 1.1 KB

πŸ“ˆ C++ Order Book Simulator

A real-time order matching engine implemented in C++, simulating various order types commonly used in trading systems. This project demonstrates data structure design, execution logic, and unit testing for realistic order flow behavior β€” inspired by electronic trading infrastructure.


πŸ’‘ Features

  • Implements major order types:
    • Good Till Cancel (GTC)
    • Fill And Kill (FAK)
    • Fill Or Kill (FOK)
    • Good For Day (GFD)
    • Market Orders
  • Tracks bid/ask spread and handles partial fills
  • Uses std::map for O(log N) insertions and lookups
  • Unit-tested using Google Test Framework

🧠 Concepts Demonstrated

  • Matching engine logic and trade execution
  • Efficient order book using std::map
  • Handling edge cases (partial fills, price improvement, empty books)
  • C++ testing and validation of execution paths
  • Principles inspired by options trading simulations

πŸš€ Build & Run

Requires C++17 and Google Test.

g++ -std=c++17 -Iinclude -lgtest -lgtest_main -pthread src/*.cpp tests/*.cpp -o orderbook_test
./orderbook_test