File size: 9,587 Bytes
63b9c5d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
{
  "server_retcodes": [
    {
      "code": "10004",
      "name": "REQUOTE",
      "meaning": "Price changed before execution; broker offers a new price"
    },
    {
      "code": "10006",
      "name": "REJECT",
      "meaning": "Request rejected by the server"
    },
    {
      "code": "10007",
      "name": "CANCEL",
      "meaning": "Request cancelled by the trader"
    },
    {
      "code": "10008",
      "name": "PLACED",
      "meaning": "Order placed — success, not an error"
    },
    {
      "code": "10009",
      "name": "DONE",
      "meaning": "Request completed — success, not an error"
    },
    {
      "code": "10010",
      "name": "DONE_PARTIAL",
      "meaning": "Only part of the requested volume was filled"
    },
    {
      "code": "10011",
      "name": "ERROR",
      "meaning": "Request processing error on the server"
    },
    {
      "code": "10012",
      "name": "TIMEOUT",
      "meaning": "Request cancelled because it timed out"
    },
    {
      "code": "10013",
      "name": "INVALID",
      "meaning": "Malformed or invalid request"
    },
    {
      "code": "10014",
      "name": "INVALID_VOLUME",
      "meaning": "Lot size below minimum, above maximum or off the volume step"
    },
    {
      "code": "10015",
      "name": "INVALID_PRICE",
      "meaning": "The price in the request is invalid"
    },
    {
      "code": "10016",
      "name": "INVALID_STOPS",
      "meaning": "SL or TP too close, on the wrong side, or inside the stops level"
    },
    {
      "code": "10017",
      "name": "TRADE_DISABLED",
      "meaning": "Trading is disabled for the account or symbol"
    },
    {
      "code": "10018",
      "name": "MARKET_CLOSED",
      "meaning": "The market for this symbol is closed"
    },
    {
      "code": "10019",
      "name": "NO_MONEY",
      "meaning": "Not enough free margin for the requested volume"
    },
    {
      "code": "10020",
      "name": "PRICE_CHANGED",
      "meaning": "Price changed while the request was being processed"
    },
    {
      "code": "10021",
      "name": "PRICE_OFF",
      "meaning": "No quotes available to process the request (off quotes)"
    },
    {
      "code": "10022",
      "name": "INVALID_EXPIRATION",
      "meaning": "Invalid order expiration in the request"
    },
    {
      "code": "10023",
      "name": "ORDER_CHANGED",
      "meaning": "Order state changed while the request was in flight"
    },
    {
      "code": "10024",
      "name": "TOO_MANY_REQUESTS",
      "meaning": "Requests sent too frequently"
    },
    {
      "code": "10025",
      "name": "NO_CHANGES",
      "meaning": "The request contains no changes"
    },
    {
      "code": "10026",
      "name": "SERVER_DISABLES_AT",
      "meaning": "Autotrading disabled by the server"
    },
    {
      "code": "10027",
      "name": "CLIENT_DISABLES_AT",
      "meaning": "Autotrading disabled by the client terminal"
    },
    {
      "code": "10028",
      "name": "LOCKED",
      "meaning": "Request locked — already being processed"
    },
    {
      "code": "10029",
      "name": "FROZEN",
      "meaning": "Order or position frozen; too close to execution to modify"
    },
    {
      "code": "10030",
      "name": "INVALID_FILL",
      "meaning": "Unsupported order filling mode for this symbol"
    },
    {
      "code": "10031",
      "name": "CONNECTION",
      "meaning": "No connection with the trade server"
    },
    {
      "code": "10032",
      "name": "ONLY_REAL",
      "meaning": "Operation allowed only on live accounts"
    },
    {
      "code": "10033",
      "name": "LIMIT_ORDERS",
      "meaning": "Pending order limit for the account reached"
    },
    {
      "code": "10034",
      "name": "LIMIT_VOLUME",
      "meaning": "Volume limit for the symbol reached"
    },
    {
      "code": "10035",
      "name": "INVALID_ORDER",
      "meaning": "Incorrect or prohibited order type"
    },
    {
      "code": "10036",
      "name": "POSITION_CLOSED",
      "meaning": "The position is already closed"
    },
    {
      "code": "10038",
      "name": "INVALID_CLOSE_VOLUME",
      "meaning": "Close volume exceeds the open position volume"
    },
    {
      "code": "10039",
      "name": "CLOSE_ORDER_EXIST",
      "meaning": "A close order for this position already exists"
    },
    {
      "code": "10040",
      "name": "LIMIT_POSITIONS",
      "meaning": "Open position limit for the account reached"
    },
    {
      "code": "10041",
      "name": "REJECT_CANCEL",
      "meaning": "Pending order activation rejected; order cancelled"
    },
    {
      "code": "10042",
      "name": "LONG_ONLY",
      "meaning": "Only long positions allowed on this symbol"
    },
    {
      "code": "10043",
      "name": "SHORT_ONLY",
      "meaning": "Only short positions allowed on this symbol"
    },
    {
      "code": "10044",
      "name": "CLOSE_ONLY",
      "meaning": "Only position closing allowed on this symbol"
    },
    {
      "code": "10045",
      "name": "FIFO_CLOSE",
      "meaning": "Positions must be closed in FIFO order (US accounts)"
    },
    {
      "code": "10046",
      "name": "HEDGE_PROHIBITED",
      "meaning": "Opposite positions on the same symbol are prohibited"
    }
  ],
  "mql_runtime_errors": [
    {
      "runtime_code": "4752",
      "name": "ERR_TRADE_DISABLED",
      "what_it_means": "Trading by expert advisors is prohibited",
      "where_the_real_reason_is": "Retcode 10027 — the Algo Trading button or EA permission"
    },
    {
      "runtime_code": "4753",
      "name": "ERR_TRADE_POSITION_NOT_FOUND",
      "what_it_means": "The position ticket does not exist",
      "where_the_real_reason_is": "Usually a netting account that has already merged the position"
    },
    {
      "runtime_code": "4754",
      "name": "ERR_TRADE_ORDER_NOT_FOUND",
      "what_it_means": "The order ticket does not exist",
      "where_the_real_reason_is": "Already filled, cancelled, or the wrong ticket"
    },
    {
      "runtime_code": "4755",
      "name": "ERR_TRADE_DEAL_NOT_FOUND",
      "what_it_means": "The deal ticket does not exist",
      "where_the_real_reason_is": "History not yet selected with HistorySelect()"
    },
    {
      "runtime_code": "4756",
      "name": "ERR_TRADE_SEND_FAILED",
      "what_it_means": "The trade request was not sent, or was rejected",
      "where_the_real_reason_is": "MqlTradeResult.retcode — any of the codes in the table above"
    },
    {
      "runtime_code": "4758",
      "name": "ERR_TRADE_CALC_FAIL",
      "what_it_means": "OrderCalcMargin or OrderCalcProfit failed",
      "where_the_real_reason_is": "Bad symbol, volume or price passed to the calculation"
    },
    {
      "runtime_code": "4759",
      "name": "ERR_TRADE_WRONG_PROPERTY",
      "what_it_means": "Wrong trade property requested",
      "where_the_real_reason_is": "A code error in the EA, not the broker"
    }
  ],
  "mt4_to_mt5_mapping": [
    {
      "mt4_error": "129",
      "mt4_name": "ERR_INVALID_PRICE",
      "mt5_retcode": "10015",
      "diagnosis": "Invalid price — see invalid price"
    },
    {
      "mt4_error": "130",
      "mt4_name": "ERR_INVALID_STOPS",
      "mt5_retcode": "10016",
      "diagnosis": "Stop too close or wrong side — see invalid stops"
    },
    {
      "mt4_error": "131",
      "mt4_name": "ERR_INVALID_TRADE_VOLUME",
      "mt5_retcode": "10014",
      "diagnosis": "Lot size off the min/max/step — see invalid volume"
    },
    {
      "mt4_error": "132",
      "mt4_name": "ERR_MARKET_CLOSED",
      "mt5_retcode": "10018",
      "diagnosis": "Outside the session — see market closed"
    },
    {
      "mt4_error": "133",
      "mt4_name": "ERR_TRADE_DISABLED",
      "mt5_retcode": "10017",
      "diagnosis": "Trading disabled for the account or symbol"
    },
    {
      "mt4_error": "134",
      "mt4_name": "ERR_NOT_ENOUGH_MONEY",
      "mt5_retcode": "10019",
      "diagnosis": "Free margin — see not enough money"
    },
    {
      "mt4_error": "135",
      "mt4_name": "ERR_PRICE_CHANGED",
      "mt5_retcode": "10020",
      "diagnosis": "Price moved during processing"
    },
    {
      "mt4_error": "136",
      "mt4_name": "ERR_OFF_QUOTES",
      "mt5_retcode": "10021",
      "diagnosis": "No quotes available — see no quotes"
    },
    {
      "mt4_error": "138",
      "mt4_name": "ERR_REQUOTE",
      "mt5_retcode": "10004",
      "diagnosis": "Requote — see requotes"
    },
    {
      "mt4_error": "146",
      "mt4_name": "ERR_TRADE_CONTEXT_BUSY",
      "mt5_retcode": "— (10024 is the nearest)",
      "diagnosis": "MT5 has no trade context lock; see trade context busy"
    },
    {
      "mt4_error": "148",
      "mt4_name": "ERR_TRADE_TOO_MANY_ORDERS",
      "mt5_retcode": "10033",
      "diagnosis": "Pending order limit reached"
    },
    {
      "mt4_error": "4109",
      "mt4_name": "ERR_TRADE_NOT_ALLOWED",
      "mt5_retcode": "10027",
      "diagnosis": "EA not permitted to trade — see AutoTrading disabled"
    },
    {
      "mt4_error": "4112",
      "mt4_name": "AutoTrading disabled by server",
      "mt5_retcode": "10026",
      "diagnosis": "Broker-side flag — see AutoTrading disabled"
    }
  ]
}