Skip to content

Orderbook simulation in cpp. Built the base OrderBook with basic matching (might change later) and market and Limit ordertypes.

Notifications You must be signed in to change notification settings

ismaeelbashir03/OrderBookSimulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Market Simulation

Overview

This project is a market simulation that implements an order book with agents that can trade. The agents will trade using procedurally generated data. The simulation will be extended to include various market conditions such as bullish and bearish trends.

Features

  • Order Book: An order book that supports adding, cancelling and modifying Limit Orders, and Market orders with a matching algorithm.
  • Procedural Agents: Can run simulated agent orders on exchange for any number of days.
  • Market Conditions: (Upcoming) Simulations of different market conditions such as bullish and bearish trends.

Todos

  • Implement Order Book

    • Implement Limit Orders

    • Implement Market Orders

    • Implement Matching Algorithm

    • Implement Cancel Orders

    • Implement Modify Orders

    • Make sure there are no memory leaks (make valgrind)

    • Stress test the order book (make stress_test)

  • Implement Agents

    • Implement Agents that can place orders in the market

    • Implement Agents that can cancel orders in the market

    • Implement Agents that can modify orders in the market

  • Implement Market Conditions

Installation

To get started with this project, follow these steps:

  1. Clone the repository:

    git clone https://github.com/ismaeelbashir03/OrderBookSimulation.git
    cd OrderBookSimulation
  2. Install dependencies: Ensure you have g++ installed. You can install it using the following command:

    sudo apt-get install g++

    (Optional) Ensure you have valgrind installed. You can install it using the following command:

    sudo apt-get install valgrind
  3. Build the project and run it:

Usage

To run the order book (small test in main.cpp):

make orderbook

To run the agent simulation (simulates orders with procedural generation):

make agent

To run the stress test (generates 1 million random orders and tests the order book):

make stress_test

To run the valgrind test (checks for memory leaks):

make valgrind

To run leak for mac (checks for memory leaks):

make leak

To run tests (unit tests):

make tests

About

Orderbook simulation in cpp. Built the base OrderBook with basic matching (might change later) and market and Limit ordertypes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published