-
Notifications
You must be signed in to change notification settings - Fork 2
/
Exchange.h
57 lines (43 loc) · 1.02 KB
/
Exchange.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
52
53
54
55
56
57
/*
* Exchange.h
*
* Created on: Nov 19, 2016
* Author: rocco
*/
#ifndef EXCHANGE_H_
#define EXCHANGE_H_
#include <iostream>
#include "fakeTime.h"
#include "Queue.h"
#include "ExperimentType.h"
#include "Results.h"
#include "Bot.h"
#include <fstream>
#include <time.h>
#include <pthread.h>
using namespace std;
class Exchange {
public:
Exchange();
Exchange(int mov1, int mov2, char expt, int numTests);
Results startSim();
Results getFitness(int savingFact, double startMon); // change to return a "Result" object
void printByDay();
void tick(bool pass);
void CSVExport(Results data[], int size);
ExperimentType* getExp();
int getCorrespondingPosition(double portfolioVal, int interval, int min); // O(1) !!!!!!!!!!!!!!!!!!!!!!!!!!
Exchange* copy();
bool crashed();
bool yearHasPassed();
double getPrice();
double getMovingAvg(Queue data);
fakeTime* getTime();
private:
ExperimentType* exp;
double price;
fakeTime* TIME;
double updatePrice();
bool newDay(int prevDay);
};
#endif /* EXCHANGE_H_ */