Orderbook Simulation
OrderbookSim is a C++ application simulating a financial market order book. It efficiently manages and matches buy and sell orders while calculating the Volume-Weighted Average Price (VWAP).
Functions
OrderbookSim.cpp File Reference

Contains the main function for simulating an orderbook with random orders. More...

#include <iostream>
#include "Orderbook.hpp"
#include <random>

Functions

void randomOrderSimulation (const int n)
 Simulates random order entries in the orderbook. More...
 
int main ()
 The main function where program execution begins. More...
 

Detailed Description

Contains the main function for simulating an orderbook with random orders.

This file initializes an Orderbook instance and performs a simulation by adding randomly generated orders. It demonstrates the functionality of the Orderbook class, including adding orders, printing the orderbook, and saving it to JSON.

Function Documentation

◆ main()

int main ( )

The main function where program execution begins.

Initializes the orderbook simulation with a predefined number of random orders.

Returns
An integer representing the program's exit status.

◆ randomOrderSimulation()

void randomOrderSimulation ( const int  n)

Simulates random order entries in the orderbook.

Simulates the addition of random orders to an Orderbook instance.

Parameters
nThe number of random orders to simulate.

Generates n random orders with randomized types, sides, prices, and quantities. After adding all orders, it prints the orderbook and saves its data to JSON.

Parameters
nThe number of random orders to add to the orderbook.

< Orderbook instance for the simulation.

< Distribution for random order types.

< Distribution for random order sides.

< Distribution for random order prices.

< Distribution for random order quantities.