Add Initial commit for further testing

This commit is contained in:
Lev
2021-06-12 10:36:26 -05:00
parent 440e744ef8
commit 01becd46fa
12 changed files with 4151 additions and 0 deletions

View File

@ -0,0 +1,37 @@
#pragma once
#include <string>
enum class OrderBookType{bid, ask, unknown, sale};
class OrderBookEntry
{
public:
OrderBookEntry( double _price,
double _amount,
std::string _timestamp,
std::string _product,
OrderBookType _orderType);
static OrderBookType stringToOrderBookType(std::string s);
static bool compareByTimestamp(OrderBookEntry& entry1, OrderBookEntry& entry2)
{
return entry1.timestamp < entry2.timestamp;
}
static bool compareByPriceAsc (OrderBookEntry& entry1, OrderBookEntry& entry2)
{
return entry1.timestamp < entry2.timestamp;
}
static bool compareByPriceDesc (OrderBookEntry& entry1, OrderBookEntry& entry2)
{
return entry1.timestamp > entry2.timestamp;
}
double price;
double amount;
std::string timestamp;
std::string product;
OrderBookType orderType;
};