Add Initial commit

This commit is contained in:
Lev
2021-07-01 15:27:04 -05:00
parent e95d11f309
commit 21d82edc88
13 changed files with 1026221 additions and 0 deletions

View File

@ -0,0 +1,40 @@
#pragma once
#include <string>
enum class OrderBookType{bid, ask, unknown, asksale, bidsale};
class OrderBookEntry
{
public:
OrderBookEntry( double _price,
double _amount,
std::string _timestamp,
std::string _product,
OrderBookType _orderType,
std::string username = "dataset");
static OrderBookType stringToOrderBookType(std::string s);
static bool compareByTimestamp(OrderBookEntry& e1, OrderBookEntry& e2)
{
return e1.timestamp < e2.timestamp;
}
static bool compareByPriceAsc(OrderBookEntry& e1, OrderBookEntry& e2)
{
return e1.price < e2.price;
}
static bool compareByPriceDesc(OrderBookEntry& e1, OrderBookEntry& e2)
{
return e1.price > e2.price;
}
double price;
double amount;
std::string timestamp;
std::string product;
OrderBookType orderType;
std::string username;
};