Skip to content

InvincibleThinker/Order_Book

Repository files navigation

📈 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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published