mirror of
https://github.com/Ichinga-Samuel/aiomql.git
synced 2026-08-13 20:08:04 +00:00
v4
This commit is contained in:
+86
-74
@@ -1,68 +1,71 @@
|
||||
# Models
|
||||
This module contains the models used in the aiomql package. These models are used to represent the data returned from the MetaTrader 5 terminal.
|
||||
They are all subclasses of the `Base` class.
|
||||
|
||||
This module contains the models used in the aiomql package. These models are used to represent the data returned from
|
||||
the MetaTrader 5 terminal. They are all subclasses of the `Base` class.
|
||||
|
||||
## Table of Contents
|
||||
- [AccountInfo](#AccountInfo)
|
||||
- [TerminalInfo](#TerminalInfo)
|
||||
- [SymbolInfo](#SymbolInfo)
|
||||
- [BookInfo](#BookInfo)
|
||||
- [TradeOrder](#TradeOrder)
|
||||
- [TradeRequest](#TradeRequest)
|
||||
- [OrderCheckResult](#OrderCheckResult)
|
||||
- [OrderSendResult](#OrderSendResult)
|
||||
- [TradePosition](#TradePosition)
|
||||
- [TradeDeal](#TradeDeal)
|
||||
- [AccountInfo](#models.account_info)
|
||||
- [TerminalInfo](#models.terminal_info)
|
||||
- [SymbolInfo](#models.symbol.info)
|
||||
- [BookInfo](#models.book_info)
|
||||
- [TradeOrder](#models.trade_order)
|
||||
- [TradeRequest](#models_trade_request)
|
||||
- [OrderCheckResult](#models.order_check_result)
|
||||
- [OrderSendResult](#models.order_send_result)
|
||||
- [TradePosition](#models.trade_position)
|
||||
- [TradeDeal](#models.trade_deal)
|
||||
|
||||
<a id="AccountInfo"></a>
|
||||
## AccountInfo
|
||||
|
||||
<a id="models.account_info"></a>
|
||||
### AccountInfo
|
||||
```python
|
||||
class AccountInfo(Base)
|
||||
```
|
||||
Account Information Class.
|
||||
#### Attributes
|
||||
| Name | Type | Description | Default |
|
||||
|----------------------|--------------------|------------------------------------------|---------|
|
||||
| `login` | `int` | Account number | |
|
||||
| `password` | `str` | Account password | |
|
||||
| `server` | `str` | Trade server name | |
|
||||
| `trade_mode` | AccountTradeMode | Trade mode | |
|
||||
| `balance` | `float` | Account balance | |
|
||||
| `leverage` | `float` | Account leverage | |
|
||||
| `profit` | `float` | Account profit | |
|
||||
| `point` | `float` | Point size | |
|
||||
| `amount` | `float` | Account amount | 0 |
|
||||
| `equity` | `float` | Account equity | |
|
||||
| `credit` | `float` | Account credit | |
|
||||
| `margin` | `float` | Account margin | |
|
||||
| `margin_level` | `float` | Margin level | |
|
||||
| `margin_free` | `float` | Free margin | |
|
||||
| `margin_mode` | AccountMarginMode | Margin calculation mode | |
|
||||
| `margin_so_mode` | AccountStopoutMode | Stop out mode | |
|
||||
| `margin_so_call` | `float` | Margin call level | |
|
||||
| `margin_so_so` | `float` | Stop out level | |
|
||||
| `margin_initial` | `float` | Initial margin | |
|
||||
| `margin_maintenance` | `float` | Maintenance margin | |
|
||||
| `fifo_close` | `bool` | FIFO close flag | |
|
||||
| `limit_orders` | `float` | Limit orders | |
|
||||
| `currency` | `str` | Account currency | "USD" |
|
||||
| `trade_allowed` | `bool` | Trade allowed flag | True |
|
||||
| `trade_expert` | `bool` | Trade expert flag | True |
|
||||
| `currency_digits` | `int` | Number of digits after the decimal point | |
|
||||
| `assets` | `float` | Assets | |
|
||||
| `liabilities` | `float` | Liabilities | |
|
||||
| `commission_blocked` | `float` | Blocked commission | |
|
||||
| `name` | `str` | Account name | |
|
||||
| `company` | `str` | Company name | |
|
||||
#### Attributes:
|
||||
| Name | Type | Description | Default |
|
||||
|----------------------|----------------------|------------------------------------------|---------|
|
||||
| `login` | `int` | Account number | |
|
||||
| `password` | `str` | Account password | |
|
||||
| `server` | `str` | Trade server name | |
|
||||
| `trade_mode` | AccountTradeMode | Trade mode | |
|
||||
| `balance` | `float` | Account balance | |
|
||||
| `leverage` | `float` | Account leverage | |
|
||||
| `profit` | `float` | Account profit | |
|
||||
| `point` | `float` | Point size | |
|
||||
| `amount` | `float` | Account amount | 0 |
|
||||
| `equity` | `float` | Account equity | |
|
||||
| `credit` | `float` | Account credit | |
|
||||
| `margin` | `float` | Account margin | |
|
||||
| `margin_level` | `float` | Margin level | |
|
||||
| `margin_free` | `float` | Free margin | |
|
||||
| `margin_mode` | `AccountMarginMode` | Margin calculation mode | |
|
||||
| `margin_so_mode` | `AccountStopoutMode` | Stop out mode | |
|
||||
| `margin_so_call` | `float` | Margin call level | |
|
||||
| `margin_so_so` | `float` | Stop out level | |
|
||||
| `margin_initial` | `float` | Initial margin | |
|
||||
| `margin_maintenance` | `float` | Maintenance margin | |
|
||||
| `fifo_close` | `bool` | FIFO close flag | |
|
||||
| `limit_orders` | `float` | Limit orders | |
|
||||
| `currency` | `str` | Account currency | "USD" |
|
||||
| `trade_allowed` | `bool` | Trade allowed flag | True |
|
||||
| `trade_expert` | `bool` | Trade expert flag | True |
|
||||
| `currency_digits` | `int` | Number of digits after the decimal point | |
|
||||
| `assets` | `float` | Assets | |
|
||||
| `liabilities` | `float` | Liabilities | |
|
||||
| `commission_blocked` | `float` | Blocked commission | |
|
||||
| `name` | `str` | Account name | |
|
||||
| `company` | `str` | Company name | |
|
||||
|
||||
<a id="TerminalInfo"></a>
|
||||
## TerminalInfo
|
||||
|
||||
<a id="models.terminal_info"></a>
|
||||
### TerminalInfo
|
||||
```python
|
||||
class TerminalInfo(Base)
|
||||
```
|
||||
Terminal information class. Holds information about the terminal.
|
||||
|
||||
#### Attributes
|
||||
#### Attributes:
|
||||
| Name | Type | Description | Default |
|
||||
|-------------------------|---------|----------------------------|---------|
|
||||
| `community_account` | `bool` | Community account flag | |
|
||||
@@ -88,13 +91,14 @@ Terminal information class. Holds information about the terminal.
|
||||
| `data_path` | `str` | Data path | |
|
||||
| `commondata_path` | `str` | Common data path | |
|
||||
|
||||
<a id="SymbolInfo"></a>
|
||||
## SymbolInfo
|
||||
|
||||
<a id="models.symbol_info"></a>
|
||||
### SymbolInfo
|
||||
```python
|
||||
class SymbolInfo(Base)
|
||||
```
|
||||
Symbol Information Class. Symbols are financial instruments available for trading in the MetaTrader 5 terminal.
|
||||
#### Attributes
|
||||
#### Attributes:
|
||||
| Name | Type | Description | Default |
|
||||
|------------------------------|------------------------|----------------------------|---------|
|
||||
| `name` | `str` | Symbol name | |
|
||||
@@ -195,13 +199,14 @@ Symbol Information Class. Symbols are financial instruments available for tradin
|
||||
| `page` | `str` | Page | |
|
||||
| `path` | `str` | Path | |
|
||||
|
||||
<a id="BookInfo"></a>
|
||||
## BookInfo
|
||||
|
||||
<a id="models.book_info"></a>
|
||||
### BookInfo
|
||||
```python
|
||||
class BookInfo(Base)
|
||||
```
|
||||
Book Information Class.
|
||||
#### Attributes
|
||||
#### Attributes:
|
||||
| Name | Type | Description | Default |
|
||||
|--------------|------------|-------------|---------|
|
||||
| `symbol` | `str` | Symbol | |
|
||||
@@ -210,13 +215,15 @@ Book Information Class.
|
||||
| `volume` | `float` | Volume | |
|
||||
| `volume_dbl` | `float` | Volume dbl | |
|
||||
|
||||
<a id="TradeOrder"></a>
|
||||
## TradeOrder
|
||||
|
||||
<a id="models.trade_order"></a>
|
||||
#### TradeOrder
|
||||
```python
|
||||
class TradeOrder(Base)
|
||||
```
|
||||
Trade Order Class.
|
||||
#### Attributes
|
||||
|
||||
#### Attributes:
|
||||
| Name | Type | Description | Default |
|
||||
|-------------------|----------------|-----------------|---------|
|
||||
| `ticket` | `int` | Ticket | |
|
||||
@@ -244,13 +251,14 @@ Trade Order Class.
|
||||
| `comment` | `str` | Comment | |
|
||||
| `external_id` | `str` | External id | |
|
||||
|
||||
<a id="TradeRequest"></a>
|
||||
|
||||
<a id="models.trade_request"></a>
|
||||
## TradeRequest
|
||||
```python
|
||||
class TradeRequest(Base)
|
||||
```
|
||||
Trade Request Class.
|
||||
#### Attributes
|
||||
#### Attributes:
|
||||
| Name | Type | Description | Default |
|
||||
|----------------|--------------|--------------|---------|
|
||||
| `action` | TradeAction | Action | |
|
||||
@@ -272,13 +280,14 @@ Trade Request Class.
|
||||
| `magic` | `int` | Magic | |
|
||||
| `deviation` | `int` | Deviation | |
|
||||
|
||||
<a id="OrderCheckResult"></a>
|
||||
## OrderCheckResult
|
||||
|
||||
<a id="models.order_check_result"></a>
|
||||
### OrderCheckResult
|
||||
```python
|
||||
class OrderCheckResult(Base)
|
||||
```
|
||||
Order Check Result
|
||||
#### Attributes
|
||||
#### Attributes:
|
||||
| Name | Type | Description | Default |
|
||||
|----------------|----------------|--------------|---------|
|
||||
| `retcode` | `int` | Retcode | |
|
||||
@@ -291,14 +300,15 @@ Order Check Result
|
||||
| `comment` | `str` | Comment | |
|
||||
| `request` | `TradeRequest` | Request | |
|
||||
|
||||
<a id="OrderSendResult"></a>
|
||||
## OrderSendResult
|
||||
|
||||
<a id="models.order_send_result"></a>
|
||||
### OrderSendResult
|
||||
```python
|
||||
class OrderSendResult(Base)
|
||||
```
|
||||
Order Send Result
|
||||
|
||||
#### Attributes
|
||||
#### Attributes:
|
||||
| Name | Type | Description | Default |
|
||||
|--------------------|----------------|------------------|---------|
|
||||
| `retcode` | `int` | Retcode | |
|
||||
@@ -314,13 +324,14 @@ Order Send Result
|
||||
| `retcode_external` | `int` | Retcode external | |
|
||||
| `profit` | `float` | Profit | |
|
||||
|
||||
<a id="TradePosition"></a>
|
||||
## TradePosition
|
||||
|
||||
<a id="models.trade_position"></a>
|
||||
### TradePosition
|
||||
```python
|
||||
class TradePosition(Base)
|
||||
```
|
||||
Trade Position
|
||||
#### Attributes
|
||||
#### Attributes:
|
||||
| Name | Type | Description | Default |
|
||||
|-------------------|------------------|-----------------|---------|
|
||||
| `ticket` | `int` | Ticket | |
|
||||
@@ -343,13 +354,14 @@ Trade Position
|
||||
| `comment` | `str` | Comment | |
|
||||
| `external_id` | `str` | External id | |
|
||||
|
||||
<a id="TradeDeal"></a>
|
||||
## TradeDeal
|
||||
|
||||
<a id="models.trade_deal"></a>
|
||||
### TradeDeal
|
||||
```python
|
||||
class TradeDeal(Base)
|
||||
```
|
||||
Trade Deal
|
||||
#### Attributes
|
||||
#### Attributes:
|
||||
| Name | Type | Description | Default |
|
||||
|---------------|--------------|-------------|---------|
|
||||
| `ticket` | `int` | Ticket | |
|
||||
|
||||
Reference in New Issue
Block a user