-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathAlgorithm.h
32 lines (27 loc) · 946 Bytes
/
Algorithm.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
//
// Created by Ethan Young on 1/1/18.
//
#ifndef ALGORITHM_H
#define ALGORITHM_H
#include <ctime>
#include "Fund.h"
class Algorithm {
public:
Algorithm(int interval, Fund *fund, vector<string> *factorNames, int budget, int numPur, double upperLim, double lowerLim);
virtual ~Algorithm();
double predictDate(tm *Date, Stock *st);
double* selectStockDistribution(map<string, double> *percentCorrect, map<string, double> *increase, tm *date);
private:
int getDateIndex(tm* Date, Stock *st, Fund *fund);
double getPrediction(double result[], vector<string> *faName, Stock *stk, int date, vector<tm*> *dates);
int testInterval;
Fund *fund;
vector<string> *faName;
std::map<string, Stock> *stockList;
//Initialize in algorithm when ready
int totalBudget;
int numDiffPurchased;
double upperPercentLimit;
double lowerPercentLimit;
};
#endif //ALGORITHM_H