-
Notifications
You must be signed in to change notification settings - Fork 0
/
body.cpp
65 lines (52 loc) · 2.02 KB
/
body.cpp
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#include <iostream>
#include <string>
#include <vector>
enum class OrderBookType {bid, ask};
int main () {
// signed int x{-5};
// std::cout << x << std::endl;
OrderBookType orderType = OrderBookType::ask;
//OrderBookType orderType = OrderBookType::bid;
std::vector<std::string> timeStamps;
std::vector<std::string> products;
std::vector<OrderBookType> orderTypes;
std::vector<double> bids;
std::vector<double> asks;
timeStamps.push_back("2020/03/17 17:01:24.884492");
products.push_back("ETH/BTC");
orderTypes.push_back(OrderBookType::ask);
bids.push_back(0.5);
asks.push_back(0.125);
timeStamps.push_back("2021/04/18 18:02:25.884493");
products.push_back("BTC/ETH");
orderTypes.push_back(OrderBookType::bid);
bids.push_back(0.1256);
asks.push_back(0.57);
std::cout << "Order Time, Ordered Product, Order Type, Bid Amount, Ask Amount \n";
std::cout << timeStamps[0] << ", " << products[0] << ", ";
switch (orderType) {
case OrderBookType::ask : std::cout << "ask, "; break;
case OrderBookType::bid : std::cout << "bid, "; break;
}
std::cout << bids[0] << ", " << asks[0] << "\n";
std::cout << timeStamps[1] << ", " << products[1] << ", ";
switch (orderType) {
case OrderBookType::ask : std::cout << "ask, "; break;
case OrderBookType::bid : std::cout << "bid, "; break;
}
std::cout << bids[1] << ", " << asks[1] << "\n";
// std::cout << "Order Time, Ordered Product, Order Type, Bid Amount, Ask Amount \n";
// std::cout << entries[0].timeStamps << ", " << entries[0].products << ", ";
// switch (orderType) {
// case OrderBookType::ask : std::cout << "ask, "; break;
// case OrderBookType::bid : std::cout << "bid, "; break;
// }
// std::cout << entries[0].bids << ", " << entries[0].asks << "\n";
// std::cout << entries[1].timeStamps << ", " << entries[1].products << ", ";
// switch (orderType) {
// case OrderBookType::ask : std::cout << "ask, "; break;
// case OrderBookType::bid : std::cout << "bid, "; break;
// }
// std::cout << entries[1].bids << ", " << entries[1].asks << "\n";
return 0;
}