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,38 @@
#pragma once
#include "OrderBookEntry.h"
#include "CSVReader.h"
#include <string>
#include <vector>
class OrderBook
{
public:
/** construct, reading a csv data file */
OrderBook(std::string filename);
/** return vector of all know products in the dataset*/
std::vector<std::string> getKnownProducts();
/** return vector of Orders according to the sent filters*/
std::vector<OrderBookEntry> getOrders(OrderBookType type,
std::string product,
std::string timestamp);
/** returns the earliest time in the orderbook*/
std::string getEarliestTime();
/** returns the next time after the
* sent time in the orderbook
* If there is no next timestamp, wraps around to the start
* */
std::string getNextTime(std::string timestamp);
void insertOrder(OrderBookEntry& order);
std::vector<OrderBookEntry> matchAsksToBids(std::string product, std::string timestamp);
static double getHighPrice(std::vector<OrderBookEntry>& orders);
static double getLowPrice(std::vector<OrderBookEntry>& orders);
private:
std::vector<OrderBookEntry> orders;
};