-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrderBook.h
More file actions
34 lines (21 loc) · 915 Bytes
/
OrderBook.h
File metadata and controls
34 lines (21 loc) · 915 Bytes
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
#pragma once
#include "OrderBookEntry.h"
#include "CSVReader.h"
/** Representation of the order book*/
class OrderBook
{
public:
OrderBook(std::string fileName);
std::vector<std::string> getKnownProducts();
std::vector<OrderBookEntry> getOrders(OrderBookType type,
std::string product,
std::string timestamp);
std::string getEarliestTime();
std::string getNextTime(std::string timeStamp);
void insertOrder(OrderBookEntry& order);
static double getHighPrice(std::vector<OrderBookEntry>& orders);
static double getLowPrice(std::vector<OrderBookEntry>& orders);
std::vector<OrderBookEntry> matchAsksToBids(std::string product, std::string timestamp);
private:
std::vector<OrderBookEntry> orders;
};