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).
|
Contains the main function for simulating an orderbook with random orders. More...
Functions | |
void | randomOrderSimulation (const int n) |
Simulates random order entries in the orderbook. More... | |
int | main () |
The main function where program execution begins. More... | |
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.
int main | ( | ) |
The main function where program execution begins.
Initializes the orderbook simulation with a predefined number of random orders.
void randomOrderSimulation | ( | const int | n | ) |
Simulates random order entries in the orderbook.
Simulates the addition of random orders to an Orderbook instance.
n | The 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.
n | The 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.