This commit is contained in:
Ichinga Samuel
2024-02-12 21:09:28 +01:00
parent 3f53df8375
commit b01e58ee08
68 changed files with 2986 additions and 6869 deletions
+41 -35
View File
@@ -1,21 +1,27 @@
## <a id="terminal"></a> Terminal
Terminal related functions and properties
# Terminal
## Table of Contents
- [Terminal](#terminal)
- [initialize](#initialize)
- [version](#version)
- [info](#info)
- [symbols_total](#symbols_total)
<a id="terminal"></a>
### Terminal
```python
class Terminal(TerminalInfo)
```
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.
### Attributes:
|Name| Type | Description | Default |
|---|---------------------|------------------------------------------------|----|
|**initialized**|**bool** | check if initial request has been sent to the terminal to get terminal info. | False |
|**mt5**|**MetaTrader** | MetaTrader instance | None |
|**config**|**Config** | Config instance | None |
### Notes:
Other attributes are defined in the TerminalInfo Class
#### Attributes
| Name | Type | Description | Default |
|---------------|--------------|------------------------------------------------------------------------------|---------|
| `initialized` | `bool` | check if initial request has been sent to the terminal to get terminal info. | False |
| `mt5` | `MetaTrader` | MetaTrader instance | None |
| `config` | `Config` | Config instance | None |
<a id="initialize"></a>
### initialize
```python
async def initialize() -> bool
@@ -23,29 +29,29 @@ 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
i.e login, password, server, as keyword arguments, path can be omitted.
#### Returns:
|Type|Description|
|---|---|
|**bool**|True if successful else False|
i.e. login, password, server, as keyword arguments, path can be omitted.
#### Returns
| Type | Description |
|--------|-------------------------------|
| `bool` | True if successful else False |
<a id="version"></a>
### version
```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
#### Returns
| Type | Description |
|-----------|------------------------------------|
| `Version` | version of tuple as Version object |
#### Raises
| Exception | Description |
|--------------|--------------------------------------------|
| `ValueError` | If the terminal version cannot be obtained |
#### Returns:
|Type|Description|
|---|---|
|**Version**|version of tuple as Version object|
#### Raises:
|Exception|Description|
|---|---|
|**ValueError**|If the terminal version cannot be obtained|
<a id="info"></a>
### info
```python
async def info()
@@ -53,19 +59,19 @@ 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().
#### Returns
| Type | Description |
|----------------|----------------------------------------------------|
| `TerminalInfo` | Terminal status and settings as a terminal object. |
#### Returns:
|Type|Description|
|---|---|
|**TerminalInfo**|Terminal status and settings as a terminal object.|
<a id="symbols_total"></a>
### symbols\_total
```python
async def symbols_total() -> int
```
Get the number of all financial instruments in the MetaTrader 5 terminal.
#### Returns:
|Type|Description|
|---|---|
|**int**|Total number of available symbols|
#### Returns
| Type | Description |
|-------|-----------------------------------|
| `int` | Total number of available symbols |