Please refer to my github for the code: https://github.com/DongliangLarryYi.
1. Data Structure
1.1 A
basic order
Each order include ID, Side (buy or sell), Price, and Size.
// Thanks to Daniel Cao who provided part of
this code
#include <iostream>
#include <list>
#include <algorithm>
#include <iterator>
#include <fstream>
#define MAX_ID 100000 // at most 100000 orders
using namespace std;
// structure of an order which include id,
side, price, size and related functions
class Order{
private:
int
id;
char
side;
double
price;
int
size;