-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathStock.h
47 lines (41 loc) · 1.2 KB
/
Stock.h
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
35
36
37
38
39
40
41
42
43
44
45
46
47
/*
* Stock.h
*
* Created on: Dec 25, 2017
* Author: ethanyoung
*/
#ifndef STOCK_H_
#define STOCK_H_
#include "Factor.h"
#include <vector>
#include <map>
#include <ctime>
#include <string>
class Stock {
public:
Stock();
Stock(std::string stockName);
virtual ~Stock();
bool buy();
bool sell();
float getFactorValue(std::string factorName, tm* Date); //Return -1 if factor doesnt exist
void setFactorValue(std::string factorName, tm* Date, float value);
void addFactor(Factor factor);
std::string getName();
int convertDate(tm* Date);
void addPred(std::string algoName, double value, int date);
std::map<int,double>* getPredList(std::string algoName);
void addActualDiff(std::string algoName, double actual, double predicted, int date);
private:
//std::map<int, float> priceClose;
//std::map<int, float> priceOpen;
//std::map<int, float> priceHigh;
//std::map<int, float> priceLow;
std::map<std::string, std::map<int,double>*> predAlgorithms;
std::map<std::string, std::map<int,double>*> resultsAlgo;
//std::map<int, float> purchaseHistory;
std::map<std::string, Factor> Factors;
int numDays;
std::string name;
};
#endif /* STOCK_H_ */