forked from EA31337/EA31337-classes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTerminal.mqh
150 lines (133 loc) · 4.3 KB
/
Terminal.mqh
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
//+------------------------------------------------------------------+
//| EA31337 - multi-strategy advanced trading robot. |
//| Copyright 2016, 31337 Investments Ltd. |
//| https://github.com/EA31337 |
//+------------------------------------------------------------------+
/*
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* Class to provide functions that return parameters of the current terminal.
*/
class Terminal {
public:
/**
* Returns terminal name.
*/
static string GetName() {
return TerminalInfoString(TERMINAL_NAME);
}
/**
* Returns folder from which the terminal is started.
*/
static string GetPath() {
return TerminalInfoString(TERMINAL_PATH);
}
/**
* Returns folder in which terminal data are stored.
*/
static string GetDataPath() {
return TerminalInfoString(TERMINAL_DATA_PATH);
}
/**
* Returns common path for all of the terminals installed on a computer.
*/
static string GetCommonPath() {
return TerminalInfoString(TERMINAL_COMMONDATA_PATH);
}
/**
* Returns folder in which expert files are stored.
*/
static string GetExpertPath() {
#ifdef __MQL4__
return GetDataPath() + "\\MQL4\\Experts";
#else
return GetDataPath() + "\\MQL5\\Experts";
#endif
}
/**
* Returns language of the terminal
*/
static string GetLanguage() {
return TerminalInfoString(TERMINAL_LANGUAGE);
}
/**
* Returns company name.
*/
static string GetCompany() {
return TerminalInfoString(TERMINAL_COMPANY);
}
};
/*
TerminalInfoInteger identifiers:
TERMINAL_BUILD
The client terminal build number
int
TERMINAL_COMMUNITY_ACCOUNT
The flag indicates the presence of MQL5.community authorization data in the terminal
bool
TERMINAL_COMMUNITY_CONNECTION
Connection to MQL5.community
bool
TERMINAL_CONNECTED
Connection to a trade server
bool
TERMINAL_DLLS_ALLOWED
Permission to use DLL
bool
TERMINAL_TRADE_ALLOWED
Permission to trade
bool
TERMINAL_EMAIL_ENABLED
Permission to send e-mails using SMTP-server and login, specified in the terminal settings
bool
TERMINAL_FTP_ENABLED
Permission to send reports using FTP-server and login, specified in the terminal settings
bool
TERMINAL_NOTIFICATIONS_ENABLED
Permission to send notifications to smartphone
bool
TERMINAL_MAXBARS
The maximal bars count on the chart
int
TERMINAL_MQID
The flag indicates the presence of MetaQuotes ID data to send Push notifications
bool
TERMINAL_CODEPAGE
Number of the code page of the language installed in the client terminal
int
TERMINAL_CPU_CORES
The number of CPU cores in the system
int
TERMINAL_DISK_SPACE
Free disk space for the MQL4\Files folder of the terminal, Mb
int
TERMINAL_MEMORY_PHYSICAL
Physical memory in the system, Mb
int
TERMINAL_MEMORY_TOTAL
Memory available to the process of the terminal , Mb
int
TERMINAL_MEMORY_AVAILABLE
Free memory of the terminal process, Mb
int
TERMINAL_MEMORY_USED
Memory used by the terminal , Mb
int
TERMINAL_SCREEN_DPI
The resolution of information display on the screen is measured as number of Dots in a line per Inch (DPI).
Knowing the parameter value, you can set the size of graphical objects so that they look the same on monitors with different resolution characteristics.
int
TERMINAL_PING_LAST
The last known value of a ping to a trade server in microseconds. One second comprises of one million microseconds
int
*/