-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
41 lines (35 loc) · 792 Bytes
/
main.cpp
File metadata and controls
41 lines (35 loc) · 792 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "OrderBook.h"
#include "Order.h"
int main()
{
OrderBook book;
Order buy1{
OrderType::GoodTillCancel,
OrderId{1},
Side::Buy,
Price{100},
Quantity{10},
Timestamp{ std::chrono::nanoseconds{0} }
};
Order sell1{
OrderType::GoodTillCancel,
OrderId{2},
Side::Sell,
Price{101},
Quantity{20},
Timestamp{ std::chrono::nanoseconds{0} }
};
Order buy2{
OrderType::GoodTillCancel,
OrderId{3},
Side::Buy,
Price{102},
Quantity{5},
Timestamp{ std::chrono::nanoseconds{0} }
};
book.addOrder(std::move(buy1));
book.addOrder(std::move(sell1));
book.addOrder(std::move(buy2));
book.printBook();
return 0;
}