Constants
MetaTrader5 API constants
MetaTrader 5 constants, such as timeframes, order types, deal types, etc.
Source code in strategytester5\MetaTrader5\constants.py
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 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 | |
DEAL_DIVIDEND = 15
class-attribute
instance-attribute
Dividend operations
DEAL_DIVIDEND_FRANKED = 16
class-attribute
instance-attribute
Franked (non-taxable) dividend operations
DEAL_ENTRY_IN = 0
class-attribute
instance-attribute
Entry in
DEAL_ENTRY_INOUT = 2
class-attribute
instance-attribute
Reverse
DEAL_ENTRY_OUT = 1
class-attribute
instance-attribute
Entry out
DEAL_ENTRY_OUT_BY = 3
class-attribute
instance-attribute
Close a position by an opposite one
DEAL_REASON_CLIENT = 0
class-attribute
instance-attribute
The deal was executed as a result of activation of an order placed from a desktop terminal
DEAL_REASON_EXPERT = 3
class-attribute
instance-attribute
The deal was executed as a result of activation of an order placed from an MQL5 program, i.e. an Expert Advisor or a script
DEAL_REASON_MOBILE = 1
class-attribute
instance-attribute
The deal was executed as a result of activation of an order placed from a mobile application
DEAL_REASON_ROLLOVER = 7
class-attribute
instance-attribute
The deal was executed due to a rollover
DEAL_REASON_SL = 4
class-attribute
instance-attribute
The deal was executed as a result of Stop Loss activation
DEAL_REASON_SO = 6
class-attribute
instance-attribute
The deal was executed as a result of the Stop Out event
DEAL_REASON_SPLIT = 9
class-attribute
instance-attribute
The deal was executed after the split (price reduction) of an instrument, which had an open position during split announcement
DEAL_REASON_TP = 5
class-attribute
instance-attribute
The deal was executed as a result of Take Profit activation
DEAL_REASON_VMARGIN = 8
class-attribute
instance-attribute
The deal was executed after charging the variation margin
DEAL_REASON_WEB = 2
class-attribute
instance-attribute
The deal was executed as a result of activation of an order placed from the web platform
DEAL_TAX = 17
class-attribute
instance-attribute
Tax charges
DEAL_TYPE_BALANCE = 2
class-attribute
instance-attribute
Balance
DEAL_TYPE_BONUS = 6
class-attribute
instance-attribute
Bonus
DEAL_TYPE_BUY = 0
class-attribute
instance-attribute
Buy
DEAL_TYPE_BUY_CANCELED = 13
class-attribute
instance-attribute
Canceled buy deal.
DEAL_TYPE_CHARGE = 4
class-attribute
instance-attribute
Additional charge
DEAL_TYPE_COMMISSION = 7
class-attribute
instance-attribute
Additional commission
DEAL_TYPE_COMMISSION_AGENT_DAILY = 10
class-attribute
instance-attribute
Daily agent commission
DEAL_TYPE_COMMISSION_AGENT_MONTHLY = 11
class-attribute
instance-attribute
Monthly agent commission
DEAL_TYPE_COMMISSION_DAILY = 8
class-attribute
instance-attribute
Daily commission
DEAL_TYPE_COMMISSION_MONTHLY = 9
class-attribute
instance-attribute
Monthly commission
DEAL_TYPE_CORRECTION = 5
class-attribute
instance-attribute
Correction
DEAL_TYPE_CREDIT = 3
class-attribute
instance-attribute
Credit
DEAL_TYPE_INTEREST = 12
class-attribute
instance-attribute
Interest rate
DEAL_TYPE_SELL = 1
class-attribute
instance-attribute
Sell
DEAL_TYPE_SELL_CANCELED = 14
class-attribute
instance-attribute
Canceled sell deal.
ORDER_FILLING_BOC = 3
class-attribute
instance-attribute
Book Or Cancel order
ORDER_FILLING_FOK = 0
class-attribute
instance-attribute
Fill Or Kill order
ORDER_FILLING_IOC = 1
class-attribute
instance-attribute
Immediately Or Cancel
ORDER_FILLING_RETURN = 2
class-attribute
instance-attribute
Return remaining volume to book
ORDER_REASON_CLIENT = 0
class-attribute
instance-attribute
The order was placed from a desktop terminal
ORDER_REASON_EXPERT = 3
class-attribute
instance-attribute
The order was placed from an MQL5-program, i.e. by an Expert Advisor or a script
ORDER_REASON_MOBILE = 1
class-attribute
instance-attribute
The order was placed from a mobile application
ORDER_REASON_SL = 4
class-attribute
instance-attribute
The order was placed as a result of Stop Loss activation
ORDER_REASON_SO = 6
class-attribute
instance-attribute
The order was placed as a result of the Stop Out event
ORDER_REASON_TP = 5
class-attribute
instance-attribute
The order was placed as a result of Take Profit activation
ORDER_REASON_WEB = 2
class-attribute
instance-attribute
The order was placed from a web platform
ORDER_STATE_CANCELED = 2
class-attribute
instance-attribute
Order canceled by client
ORDER_STATE_EXPIRED = 6
class-attribute
instance-attribute
Order expired
ORDER_STATE_FILLED = 4
class-attribute
instance-attribute
Order fully executed
ORDER_STATE_PARTIAL = 3
class-attribute
instance-attribute
Order partially executed
ORDER_STATE_PLACED = 1
class-attribute
instance-attribute
Order accepted
ORDER_STATE_REJECTED = 5
class-attribute
instance-attribute
Order rejected
ORDER_STATE_REQUEST_ADD = 7
class-attribute
instance-attribute
Order is being registered (placing to the trading system)
ORDER_STATE_REQUEST_CANCEL = 9
class-attribute
instance-attribute
Order is being deleted (deleting from the trading system)
ORDER_STATE_REQUEST_MODIFY = 8
class-attribute
instance-attribute
Order is being modified (changing its parameters)
ORDER_STATE_STARTED = 0
class-attribute
instance-attribute
Order checked, but not yet accepted by broker
ORDER_TIME_DAY = 1
class-attribute
instance-attribute
Good till current trade day order
ORDER_TIME_GTC = 0
class-attribute
instance-attribute
ORDER_TIME_GTC - Good till cancel order
ORDER_TIME_SPECIFIED = 2
class-attribute
instance-attribute
Good till expired order
ORDER_TIME_SPECIFIED_DAY = 3
class-attribute
instance-attribute
The order will be effective till 23:59:59 of the specified day. If this time is outside a trading session, the order expires in the nearest trading time.
ORDER_TYPE_BUY = 0
class-attribute
instance-attribute
Market Buy order
ORDER_TYPE_BUY_LIMIT = 2
class-attribute
instance-attribute
Buy Limit pending order
ORDER_TYPE_BUY_STOP = 4
class-attribute
instance-attribute
Buy Stop pending order
ORDER_TYPE_BUY_STOP_LIMIT = 6
class-attribute
instance-attribute
Upon reaching the order price, a pending Buy Limit order is placed at the StopLimit price
ORDER_TYPE_CLOSE_BY = 8
class-attribute
instance-attribute
Order to close a position by an opposite one
ORDER_TYPE_SELL = 1
class-attribute
instance-attribute
Market Sell order
ORDER_TYPE_SELL_LIMIT = 3
class-attribute
instance-attribute
Sell Limit pending order
ORDER_TYPE_SELL_STOP = 5
class-attribute
instance-attribute
Sell Stop pending order
ORDER_TYPE_SELL_STOP_LIMIT = 7
class-attribute
instance-attribute
Upon reaching the order price, a pending Sell Limit order is placed at the StopLimit price
POSITION_REASON_CLIENT = 0
class-attribute
instance-attribute
The position was opened as a result of activation of an order placed from a desktop terminal
POSITION_REASON_EXPERT = 3
class-attribute
instance-attribute
The position was opened as a result of activation of an order placed from an MQL5 program, i.e. an Expert Advisor or a script
POSITION_REASON_MOBILE = 1
class-attribute
instance-attribute
The position was opened as a result of activation of an order placed from a mobile application
POSITION_REASON_WEB = 2
class-attribute
instance-attribute
The position was opened as a result of activation of an order placed from the web platform
POSITION_TYPE_BUY = 0
class-attribute
instance-attribute
Buy
POSITION_TYPE_SELL = 1
class-attribute
instance-attribute
Sell
TIMEFRAME_D1 = 24 | 16384
class-attribute
instance-attribute
One-day timeframe.
TIMEFRAME_H1 = 1 | 16384
class-attribute
instance-attribute
One-hour timeframe.
TIMEFRAME_H12 = 12 | 16384
class-attribute
instance-attribute
Twelve-hour timeframe.
TIMEFRAME_H2 = 2 | 16384
class-attribute
instance-attribute
Two-hour timeframe.
TIMEFRAME_H3 = 3 | 16384
class-attribute
instance-attribute
Three-hour timeframe.
TIMEFRAME_H4 = 4 | 16384
class-attribute
instance-attribute
Four-hour timeframe.
TIMEFRAME_H6 = 6 | 16384
class-attribute
instance-attribute
Six-hour timeframe.
TIMEFRAME_H8 = 8 | 16384
class-attribute
instance-attribute
Eight-hour timeframe.
TIMEFRAME_M1 = 1
class-attribute
instance-attribute
One-minute timeframe.
TIMEFRAME_M10 = 10
class-attribute
instance-attribute
Ten-minute timeframe.
TIMEFRAME_M12 = 12
class-attribute
instance-attribute
Twelve-minute timeframe.
TIMEFRAME_M15 = 15
class-attribute
instance-attribute
Fifteen-minute timeframe.
TIMEFRAME_M2 = 2
class-attribute
instance-attribute
Two-minute timeframe.
TIMEFRAME_M20 = 20
class-attribute
instance-attribute
Twenty-minute timeframe.
TIMEFRAME_M3 = 3
class-attribute
instance-attribute
Three-minute timeframe.
TIMEFRAME_M30 = 30
class-attribute
instance-attribute
Thirty-minute timeframe.
TIMEFRAME_M4 = 4
class-attribute
instance-attribute
Four-minute timeframe.
TIMEFRAME_M5 = 5
class-attribute
instance-attribute
Five-minute timeframe.
TIMEFRAME_M6 = 6
class-attribute
instance-attribute
Six-minute timeframe.
TIMEFRAME_MN1 = 1 | 49152
class-attribute
instance-attribute
One-Month timeframe.
TIMEFRAME_W1 = 1 | 32768
class-attribute
instance-attribute
One-week timeframe.
TRADE_ACTION_CLOSE_BY = 10
class-attribute
instance-attribute
Close a position by an opposite one
TRADE_ACTION_DEAL = 1
class-attribute
instance-attribute
Place a trade order for an immediate execution with the specified parameters (market order)
TRADE_ACTION_MODIFY = 7
class-attribute
instance-attribute
Modify the parameters of the order placed previously
TRADE_ACTION_PENDING = 5
class-attribute
instance-attribute
Place a trade order for the execution under specified conditions (pending order)
TRADE_ACTION_REMOVE = 8
class-attribute
instance-attribute
Delete the pending order placed previously
TRADE_ACTION_SLTP = 6
class-attribute
instance-attribute
Modify Stop Loss and Take Profit values of an opened position