-
Notifications
You must be signed in to change notification settings - Fork 6
/
Backtest.h
51 lines (46 loc) · 1.45 KB
/
Backtest.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
48
49
50
51
//
// Created by Ethan Young on 1/1/18.
//
//Test to see if it worked
#ifndef BACKTEST_H
#define BACKTEST_H
#include "Algorithm.h"
#include <vector>
#include <ctime>
#include "Fund.h"
#include <map>
#include <string>
#include "Stock.h"
#include "Config.h"
extern std::string backtestPrompt;
class Backtest {
public:
//String is stock name, map is date to actual
std::map<std::string, std::map<int,double>*> actuals;
std::map<std::string, std::map<int,double>*> predicted;
std::map<std::string, std::map<int,double>*> difference;
std::map<std::string, std::map<int,double>*> prevDayDiffPred;
std::map<std::string, std::map<int,double>*> prevDayDiffActual;
std::vector<tm *> *dates;
std::map<string, Stock> *sl;
std::map<std::string, double> *percentCorrect;
std::map<std::string, double> *increase;
vector<string> *factorNames;
int numDays;
int startDate;
int interval;
tm *predictDate;
Algorithm *al;
Fund *fund;
int dayUnknown;
double btResults(double* results);
Backtest(Fund *fundEx, int interva, vector<string> *factors, int numDay, tm *predictedDate, bool unknown, int budget, int numPur, double upperLim, double lowerLim);
virtual ~Backtest();
void runBacktestStocks();
double userBacktestMain();
void calcPrevDayChange();
void calcPercentCorrect();
void predictDay();
int getDateIndx(tm *Date);
};
#endif //BACKTEST_H