Skip to content

Commit e547c27

Browse files
author
Marcos Pernambuco Motta
committed
Toy exchange
1 parent 7f18039 commit e547c27

File tree

4 files changed

+407
-0
lines changed

4 files changed

+407
-0
lines changed

exchange/.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
exchange
2+
exchange.dSYM
3+
exchange.dSYM/*
4+
.DS_store
5+
.vscode
6+
7+

exchange/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
CXX = g++
2+
CXXFLAGS = -std=c++17
3+
4+
exchange: exchange.cpp
5+
$(CXX) $(CXXFLAGS) -o $@ $<

exchange/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
```

0 commit comments

Comments
 (0)