-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrder.h
More file actions
21 lines (16 loc) · 766 Bytes
/
Order.h
File metadata and controls
21 lines (16 loc) · 766 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#ifndef ORDER_H
#define ORDER_H
#include <string>
struct Order {
int orderId; // Unique order ID
char side; // 'B' for Buy, 'S' for Sell
double price; // Order price
int quantity; // Quantity of the order
int timestamp; // Timestamp (e.g., microseconds)
int traderId; // Trader ID
bool isMarketOrder; // True if market order, false if limit order
Order(int id, char s, double p, int q, int t, int trader, bool market = false)
: orderId(id), side(s), price(p), quantity(q), timestamp(t), traderId(trader), isMarketOrder(market) {}
Order() : orderId(0), side('N'), price(0.0), quantity(0), timestamp(0), traderId(0), isMarketOrder(false) {}
};
#endif // ORDER_H