-
Notifications
You must be signed in to change notification settings - Fork 1
/
mainwindow.h
executable file
·68 lines (60 loc) · 1.5 KB
/
mainwindow.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
58
59
60
61
62
63
64
65
66
67
68
// mainwindow.h
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QTimer>
#include "TradingBot.h"
#include <QPixmap>
QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(const QString &username, QWidget *parent = nullptr);
~MainWindow();
void on_exitButton_clicked();
void on_HelpButton_clicked();
private slots:
void onConfirmButtonClicked();
void executeNextTradingDay();
void updateUIFromBot();
void onSimulationComplete();
void OnResetButtonClicked();
private:
Ui::MainWindow *ui;
TradingBot *tradingBot;
QTimer *updateTimer;
QString username;
void promptForStrategyChange();
int updateFrequency;
int currentSimulationDay;
void ValuesSet();
int getSelectedStrategyIndex() const;
int getSelectedDays() const;
// Member variables
int balance;
int StocksOwned;
int DayNum;
int CurrentPrice;
int CurrentBalance;
int TotalCurrenValue;
double Volatility;
double CumulativeReturn;
double MaximumDrawDown;
double ShapreRatio;
double MarketVolatility;
std::string CurrentStrategy;
std::string MarketEvent;
void updateGraphs();
// Actions
int Buys, Sells, Hold;
int LastBuys, LastSells, LastHolds;
int ProfitLossSinceStart, ProfitLossSinceLastUpdate;
int NumDay;
int strategyChoice;
int NumOfDays;
int NumOfUpdates;
};
#endif // MAINWINDOW_H