Terminal¶
Terminal state and configuration.
Models¶
TerminalInfo¶
TerminalInfo
¶
Bases: BaseModel
State and configuration of the connected MetaTrader 5 terminal.
Wraps the raw TerminalInfo struct returned by mt5.terminal_info().
Useful for verifying that the terminal is ready for trading before
submitting orders.
| ATTRIBUTE | DESCRIPTION |
|---|---|
community_account |
Whether the terminal is connected with a MQL5 community account.
TYPE:
|
community_connection |
Whether the MQL5 community server is reachable.
TYPE:
|
connected |
Whether the terminal is connected to the broker server.
TYPE:
|
dlls_allowed |
Whether DLL imports are permitted.
TYPE:
|
trade_allowed |
Whether trading is enabled in the terminal settings.
TYPE:
|
tradeapi_disabled |
Whether the trade API has been disabled by the broker.
TYPE:
|
email_enabled |
Whether email notifications are enabled.
TYPE:
|
ftp_enabled |
Whether FTP report delivery is enabled.
TYPE:
|
notifications_enabled |
Whether push notifications are enabled.
TYPE:
|
mqid |
Whether the terminal has a valid MQL5 ID.
TYPE:
|
build |
Terminal build number.
TYPE:
|
maxbars |
Maximum number of bars in a chart.
TYPE:
|
codepage |
Code page used for string encoding.
TYPE:
|
ping_last |
Last measured round-trip latency to the broker server (ms).
TYPE:
|
community_balance |
MQL5 community account balance.
TYPE:
|
retransmission |
Network packet retransmission ratio (0.0โ1.0).
TYPE:
|
company |
Broker company name as shown in the terminal.
TYPE:
|
name |
Terminal product name.
TYPE:
|
language |
Terminal interface language.
TYPE:
|
path |
Path to the terminal executable.
TYPE:
|
data_path |
Path to the terminal data directory.
TYPE:
|
commondata_path |
Path to the shared data directory for all terminals.
TYPE:
|
version
property
¶
Terminal version as a human-readable string (e.g. "Build 4000").
| RETURNS | DESCRIPTION |
|---|---|
str
|
Version string derived from the build number. |
is_ready_for_trading
property
¶
Whether the terminal is in a state where trade requests can be submitted.
All three conditions must hold: the terminal must be connected to the broker, trading must be enabled in the terminal settings, and the trade API must not have been disabled by the broker.
| RETURNS | DESCRIPTION |
|---|---|
bool
|
|
Service¶
TerminalService¶
TerminalService
¶
Retrieves terminal state and configuration from MT5.
Wraps mt5.terminal_info() via call_mt5, parses the raw
TerminalInfo struct into a typed model, and returns
Result[TerminalInfo].