-
-
Notifications
You must be signed in to change notification settings - Fork 102
/
Copy pathAccount.enum.h
149 lines (136 loc) · 5.72 KB
/
Account.enum.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
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
//+------------------------------------------------------------------+
//| EA31337 framework |
//| Copyright 2016-2021, EA31337 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/>.
*
*/
/**
* @file
* Includes Account's enums.
*/
#ifndef __MQL__
// Allows the preprocessor to include a header file when it is needed.
#pragma once
#endif
/* Account type of values for statistics. */
enum ENUM_ACC_STAT_VALUE {
ACC_BALANCE = 0,
ACC_CREDIT = 1,
ACC_EQUITY = 2,
ACC_PROFIT = 3,
ACC_MARGIN_USED = 4,
ACC_MARGIN_FREE = 5,
FINAL_ENUM_ACC_STAT_VALUE = 6
};
/* Account type of periods for statistics. */
enum ENUM_ACC_STAT_PERIOD { ACC_DAILY = 0, ACC_WEEKLY = 1, ACC_MONTHLY = 2, FINAL_ENUM_ACC_STAT_PERIOD = 3 };
/* Account type of calculation for statistics. */
enum ENUM_ACC_STAT_TYPE { ACC_VALUE_MIN = 0, ACC_VALUE_MAX = 1, ACC_VALUE_AVG = 2, FINAL_ENUM_ACC_STAT_TYPE = 3 };
/* Account type of index for statistics. */
enum ENUM_ACC_STAT_INDEX { ACC_VALUE_CURR = 0, ACC_VALUE_PREV = 1, FINAL_ENUM_ACC_STAT_INDEX = 2 };
#ifndef __MQL__
/**
* Enumeration for the current account double values.
*
* Used for function AccountInfoDouble().
*
* @docs
* https://www.mql5.com/en/docs/constants/environment_state/accountinformation
*/
enum ENUM_ACCOUNT_INFO_DOUBLE {
ACCOUNT_BALANCE, // Account balance in the deposit currency (double).
ACCOUNT_CREDIT, // Account credit in the deposit currency (double).
ACCOUNT_PROFIT, // Current profit of an account in the deposit currency (double).
ACCOUNT_EQUITY, // Account equity in the deposit currency (double).
ACCOUNT_MARGIN, // Account margin used in the deposit currency (double).
ACCOUNT_MARGIN_FREE, // Free margin of an account in the deposit currency (double).
ACCOUNT_MARGIN_LEVEL, // Account margin level in percents (double).
ACCOUNT_MARGIN_SO_CALL, // Margin call level (double).
ACCOUNT_MARGIN_SO_SO, // Margin stop out level (double).
ACCOUNT_MARGIN_INITIAL, // Initial margin (double).
ACCOUNT_MARGIN_MAINTENANCE, // Maintenance margin (double).
ACCOUNT_ASSETS, // The current assets of an account (double).
ACCOUNT_LIABILITIES, // The current liabilities on an account (double).
ACCOUNT_COMMISSION_BLOCKED, // The current blocked commission amount on an account (double).
};
/**
* Enumeration for the current account integer values.
*
* Used for function AccountInfoInteger().
*
* @docs
* https://www.mql5.com/en/docs/constants/environment_state/accountinformation
*/
enum ENUM_ACCOUNT_INFO_INTEGER {
ACCOUNT_LOGIN, // Account number (long).
ACCOUNT_TRADE_MODE, // Account trade mode (ENUM_ACCOUNT_TRADE_MODE).
ACCOUNT_LEVERAGE, // Account leverage (long).
ACCOUNT_LIMIT_ORDERS, // Maximum allowed number of active pending orders (int).
ACCOUNT_MARGIN_SO_MODE, // Mode for setting the minimal allowed margin (ENUM_ACCOUNT_STOPOUT_MODE).
ACCOUNT_TRADE_ALLOWED, // Allowed trade for the current account (bool).
ACCOUNT_TRADE_EXPERT, // Allowed trade for an Expert Advisor (bool).
ACCOUNT_MARGIN_MODE, // Margin calculation mode (ENUM_ACCOUNT_MARGIN_MODE).
ACCOUNT_CURRENCY_DIGITS, // The number of decimal places in the account currency (int).
ACCOUNT_FIFO_CLOSE, // An indication showing that positions can only be closed by FIFO rule (bool).
};
/**
* Enumeration for the current account string values.
*
* Used for function AccountInfoString().
*
* @docs
* https://www.mql5.com/en/docs/constants/environment_state/accountinformation
*/
enum ENUM_ACCOUNT_INFO_STRING {
ACCOUNT_NAME, // Client name (string).
ACCOUNT_SERVER, // Trade server name (string).
ACCOUNT_CURRENCY, // Account currency (string).
ACCOUNT_COMPANY, // Name of a company that serves the account (string).
};
/**
* Enumeration for the margin modes.
*
* @docs
* https://www.mql5.com/en/docs/constants/environment_state/accountinformation
*/
enum ENUM_ACCOUNT_MARGIN_MODE {
ACCOUNT_MARGIN_MODE_RETAIL_NETTING, // Used for the OTC markets to interpret positions in the "netting" mode.
ACCOUNT_MARGIN_MODE_EXCHANGE, // Used for the exchange markets.
ACCOUNT_MARGIN_MODE_RETAIL_HEDGING, // Used for the exchange markets where individual positions are possible.
};
/**
* Enumeration for the types of accounts on a trade server.
*
* @docs
* https://www.mql5.com/en/docs/constants/environment_state/accountinformation
*/
enum ENUM_ACCOUNT_TRADE_MODE {
ACCOUNT_TRADE_MODE_DEMO, // Demo account.
ACCOUNT_TRADE_MODE_CONTEST, // Contest account.
ACCOUNT_TRADE_MODE_REAL, // Real account.
};
/**
* Enumeration for the Stop Out modes.
*
* @docs
* https://www.mql5.com/en/docs/constants/environment_state/accountinformation
*/
enum ENUM_ACCOUNT_STOPOUT_MODE {
ACCOUNT_STOPOUT_MODE_PERCENT, // Account stop out mode in percents.
ACCOUNT_STOPOUT_MODE_MONEY, // Account stop out mode in money.
};
#endif