- initialize
- login
- shutdown
- version
- last_error
- account_info
- terminal_info
- symbols_total
- symbols_get
- symbol_info
- symbol_info_tick
- symbol_select
- market_book_add
- market_book_get
- market_book_release
- copy_rates_from
- copy_rates_from_pos
- copy_rates_range
- copy_ticks_from
- copy_ticks_range
- orders_total
- orders_get
- order_calc_margin
- order_calc_profit
- order_check
- order_send
- positions_total
- positions_get
- history_orders_total
- history_orders_get
- history_deals_total
- history_deals_get
last_error
Retorna informações sobre o último erro.
last_error() |
Valor retornado
Retorna o código do último erro e sua descrição na forma de uma tupla.
Observação
last_error() permite que obter o código de erro em caso de execução mal sucedida de qualquer função da biblioteca MetaTrader 5. É semelhante a GetLastError(), mas são usados seus próprios códigos de erro. Valores possíveis:
Constante |
Valor |
Descrição |
---|---|---|
RES_S_OK |
1 |
generic success |
RES_E_FAIL |
-1 |
generic fail |
RES_E_INVALID_PARAMS |
-2 |
invalid arguments/parameters |
RES_E_NO_MEMORY |
-3 |
no memory condition |
RES_E_NOT_FOUND |
-4 |
no history |
RES_E_INVALID_VERSION |
-5 |
invalid version |
RES_E_AUTH_FAILED |
-6 |
authorization failed |
RES_E_UNSUPPORTED |
-7 |
unsupported method |
RES_E_AUTO_TRADING_DISABLED |
-8 |
auto-trading disabled |
RES_E_INTERNAL_FAIL |
-10000 |
internal IPC general error |
RES_E_INTERNAL_FAIL_SEND |
-10001 |
internal IPC send failed |
RES_E_INTERNAL_FAIL_RECEIVE |
-10002 |
internal IPC recv failed |
RES_E_INTERNAL_FAIL_INIT |
-10003 |
internal IPC initialization fail |
RES_E_INTERNAL_FAIL_CONNECT |
-10003 |
internal IPC no ipc |
RES_E_INTERNAL_FAIL_TIMEOUT |
-10005 |
internal timeout |
Exemplo:
import MetaTrader5 as mt5
|
Veja também