- 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_pPos
- 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 la información sobre el último error.
last_error() |
Valor retornado
Retorna el código del último error y su descripción en forma de tupla.
Observación
last_error() permite obtener el código de error en el caso de que no se ejecute con éxito alguna función de la biblioteca MetaTrader 5. Es un análogo de GetLastError(), pero se usan códigos de error propios. Posibles valores:
Constante |
Valor |
Descripción |
---|---|---|
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 |
Ejemplo:
import MetaTrader5 as mt5
|
Ver también