-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrderBook.h
More file actions
34 lines (28 loc) · 1.28 KB
/
OrderBook.h
File metadata and controls
34 lines (28 loc) · 1.28 KB
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"
#include <string>
#include <vector>
class OrderBook {
public:
/** construct, reading a csv data file*/
OrderBook(std::string filename);
/** return vector of all known 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);
/** returns the prev timestep after the sent time in the order book, for getting previous timesteps values for compute average command*/
std::string getPrevTime(std::string timestamp);
static double getHighPrice(std::vector<OrderBookEntry>& orders);
static double getLowPrice(std::vector<OrderBookEntry>& orders);
static double getAvgPrice(std::vector<OrderBookEntry>& orders);
static double getEMAPrice(std::vector<OrderBookEntry>& orders);
private:
std::vector<OrderBookEntry> orders;
};