File tree Expand file tree Collapse file tree 4 files changed +407
-0
lines changed Expand file tree Collapse file tree 4 files changed +407
-0
lines changed Original file line number Diff line number Diff line change 1+ exchange
2+ exchange.dSYM
3+ exchange.dSYM /*
4+ .DS_store
5+ .vscode
6+
7+
Original file line number Diff line number Diff line change 1+ CXX = g++
2+ CXXFLAGS = -std=c++17
3+
4+ exchange : exchange.cpp
5+ $(CXX ) $(CXXFLAGS ) -o $@ $<
Original file line number Diff line number Diff line change 1+ # Toy Exchange
2+
3+ ## Build
4+ ```
5+ make
6+ ```
7+
8+ ## Run and test
9+ ```
10+ ./exchange --setup-test-fixture --interactive
11+
12+ id tradr qty bid | ask qty tradr id
13+ 4 perna 40 111 | 112 50 diego 5
14+ 3 perna 50 110 | 120 100 diego 2
15+ 1 perna 100 100 |
16+
17+ Enter command. Format is: (buy|sell|book) symbol trader price qty
18+ > buy ACME victor 112 30
19+
20+ Execution - Trader: victor Order ID: 6 Execution Type: N Side: B Quantity: 30 Price: 112
21+ Execution - Trader: victor Order ID: 6 Execution Type: E Side: B Quantity: 30 Price: 112
22+ Execution - Trader: diego Order ID: 5 Execution Type: E Side: S Quantity: 30 Price: 112
23+
24+ Enter command. Format is: (buy|sell|book) symbol trader price qty
25+ > book ACME
26+ id tradr qty bid | ask qty tradr id
27+ 4 perna 40 111 | 112 20 diego 5
28+ 3 perna 50 110 | 120 100 diego 2
29+ 1 perna 100 100 |
30+
31+ Enter command. Format is: (buy|sell|book) symbol trader price qty
32+ >
33+
34+ ```
You can’t perform that action at this time.
0 commit comments