-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTradingHeader.h
More file actions
59 lines (49 loc) · 1.26 KB
/
TradingHeader.h
File metadata and controls
59 lines (49 loc) · 1.26 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// OurTradingHeader.h
// Data for least squares analysis
class ModelData{
public:
int numPoints;
float x[MAXSIZE];
float y[MAXSIZE];
float a;
float b;
float residual[MAXSIZE];
float mean;
float variance;
float biggestDailyRise;
float biggestDailyFall;
float standarddev();
};
class TradingAccount{
public:
int today;
float price[MAXSIZE][22];
int transaction[MAXSIZE][22];
int volume[MAXSIZE][22];
int stock[MAXSIZE][22];
float balance[MAXSIZE][22];
float compiledtotal;
float commission;
int datatest;
};
//UIUX functions
class UIUX {
public:
int w, h;
UIUX (int width,int height);
void yellowsmile();
void pasthundred();
};
// UIUX and Modelling functions
void ReadDataFile(ModelData &data);
void mygraphics(int w, int h);
void CalStats ();
void leastSquares();
void Smiley(int button, int state, int x, int y); // for click functions
void realtimeheaders();
void presskey(unsigned char C, int x, int y);
// Trade set up and intialise
void InitialiseAccount(int dataSet, int labGroup, int SecurityCode, TradingAccount &account, int dataset);
void HandleExitCode(int errorCode);
void MyTrader(TradingAccount &account, ModelData &data, int dataset);
float ConcludeAcc(TradingAccount &account, int dataset);