Files
aiomql/docs/lib/terminal.md
T

85 lines
2.8 KiB
Markdown
Raw Normal View History

2024-02-12 21:09:28 +01:00
# Terminal
2023-10-11 09:49:06 +01:00
2024-02-12 21:09:28 +01:00
## Table of Contents
2024-11-10 12:25:50 +01:00
- [Terminal](#terminal.terminal)
- [initialize](#terminal.initialize)
- [version](#terminal.version)
- [info](#terminal.info)
- [symbols_total](#terminal.symbols_total)
2024-02-12 21:09:28 +01:00
2024-11-10 12:25:50 +01:00
<a id="terminal.terminal"></a>
2024-02-12 21:09:28 +01:00
### Terminal
2023-10-11 09:49:06 +01:00
```python
2024-11-10 12:25:50 +01:00
class Terminal(_Base, TerminalInfo)
2023-10-11 09:49:06 +01:00
```
Terminal Class. Get information about the MetaTrader 5 terminal. The class is a subclass of the TerminalInfo
class. It inherits all the attributes and methods of the TerminalInfo class and adds some useful methods.
2024-11-10 12:25:50 +01:00
#### Attributes:
| Name | Type | Description | Default |
|-----------|--------------|-------------------------------|---------|
| `version` | `Version` | MetaTrader5 Terminal Version. | None |
<a id="terminal.initialize"></a>
2023-10-16 15:36:31 +01:00
### initialize
2023-10-11 09:49:06 +01:00
```python
async def initialize() -> bool
```
Establish a connection with the MetaTrader 5 terminal. There are three call options. Call without parameters.
The terminal for connection is found automatically. Call specifying the path to the MetaTrader 5 terminal we
want to connect to. word path as a keyword argument Call specifying the trading account path and parameters
2024-02-12 21:09:28 +01:00
i.e. login, password, server, as keyword arguments, path can be omitted.
2024-11-10 12:25:50 +01:00
#### Returns:
2024-02-12 21:09:28 +01:00
| Type | Description |
|--------|-------------------------------|
| `bool` | True if successful else False |
2023-10-11 09:49:06 +01:00
2024-11-10 12:25:50 +01:00
<a id="terminal.version"></a>
2023-10-16 15:36:31 +01:00
### version
2023-10-11 09:49:06 +01:00
```python
async def version()
```
Get the MetaTrader 5 terminal version. This method returns the terminal version, build and release date as
a tuple of three values
2024-11-10 12:25:50 +01:00
#### Returns:
2024-02-12 21:09:28 +01:00
| Type | Description |
|-----------|------------------------------------|
| `Version` | version of tuple as Version object |
2024-11-10 12:25:50 +01:00
#### Raises:
2024-02-12 21:09:28 +01:00
| Exception | Description |
|--------------|--------------------------------------------|
| `ValueError` | If the terminal version cannot be obtained |
2023-10-11 09:49:06 +01:00
2024-11-10 12:25:50 +01:00
<a id="terminal.info"></a>
2023-10-16 15:36:31 +01:00
### info
2023-10-11 09:49:06 +01:00
```python
async def info()
```
Get the connected MetaTrader 5 client terminal status and settings. gets terminal info in the form of a
named tuple structure (namedtuple). Return None in case of an error. The info on the error can be
obtained using last_error().
2024-11-10 12:25:50 +01:00
#### Returns:
2024-02-12 21:09:28 +01:00
| Type | Description |
|----------------|----------------------------------------------------|
| `TerminalInfo` | Terminal status and settings as a terminal object. |
2023-10-11 09:49:06 +01:00
2024-11-10 12:25:50 +01:00
<a id="terminal.symbols_total"></a>
### symbols_total
2023-10-11 09:49:06 +01:00
```python
async def symbols_total() -> int
```
Get the number of all financial instruments in the MetaTrader 5 terminal.
2024-11-10 12:25:50 +01:00
#### Returns:
2024-02-12 21:09:28 +01:00
| Type | Description |
|-------|-----------------------------------|
| `int` | Total number of available symbols |