This commit is contained in:
Ichinga Samuel
2024-11-11 05:56:08 +01:00
parent 110c7c39c7
commit 72e902c4c5
58 changed files with 569 additions and 2079 deletions
+71
View File
@@ -0,0 +1,71 @@
# Table of Contents
* [aiomql.contrib.symbols.forex\_symbol](#aiomql.contrib.symbols.forex_symbol)
* [ForexSymbol](#aiomql.contrib.symbols.forex_symbol.ForexSymbol)
* [pip](#aiomql.contrib.symbols.forex_symbol.ForexSymbol.pip)
* [compute\_points](#aiomql.contrib.symbols.forex_symbol.ForexSymbol.compute_points)
* [compute\_volume\_points](#aiomql.contrib.symbols.forex_symbol.ForexSymbol.compute_volume_points)
<a id="aiomql.contrib.symbols.forex_symbol"></a>
# aiomql.contrib.symbols.forex\_symbol
<a id="aiomql.contrib.symbols.forex_symbol.ForexSymbol"></a>
## ForexSymbol Objects
```python
class ForexSymbol(Symbol)
```
Subclass of Symbol for Forex Symbols. Handles the conversion of currency and the computation of stop loss,
take profit and volume.
<a id="aiomql.contrib.symbols.forex_symbol.ForexSymbol.pip"></a>
#### pip
```python
@property
def pip()
```
Returns the pip value of the symbol. This is ten times the point value for forex symbols.
**Returns**:
- `float` - The pip value of the symbol.
<a id="aiomql.contrib.symbols.forex_symbol.ForexSymbol.compute_points"></a>
#### compute\_points
```python
def compute_points(*, amount: float, volume: float) -> float
```
Compute the number of points required for a trade. Given the amount and the volume of the trade.
**Arguments**:
- `amount` _float_ - Amount to trade
- `volume` _float_ - Volume to trade
<a id="aiomql.contrib.symbols.forex_symbol.ForexSymbol.compute_volume_points"></a>
#### compute\_volume\_points
```python
async def compute_volume_points(*,
amount: float,
points: float,
round_down: bool = False) -> float
```
Compute the volume required for a trade. Given the amount and the number of points.
**Arguments**:
- `amount` _float_ - Amount to trade
- `points` _float_ - Number of points
- `round_down` - round down the computed volume to the nearest step default True
+6 -5
View File
@@ -38,14 +38,15 @@ The MetaTrader Class provides an asynchronous wrapper around the MetaTrader5 API
- [history\_deals\_total](#history_deals_total)
- [history\_deals\_get](#history_deals_get)
<a id="MetaTrader"></a>
<a id="meta_trader.meta_trader"></a>
### MetaTrader
```python
class MetaTrader(metaclass=BaseMeta)
class MetaTrader(MetaCore)
```
The MetaTrader class is a wrapper around the MetaTrader terminal.
It provides methods for connecting to the MetaTrader terminal and retrieving data from it.
#### Attributes
#### Attributes:
| Name | Type | Description | Default |
|-------|-------|--------------------------------------------------------|------------------------|
| error | Error | The last error encountered by the MetaTrader terminal. | Error(1, 'Successful') |
@@ -62,7 +63,7 @@ async def __aenter__() -> 'MetaTrader'
Async context manager entry point.
Initializes the connection to the MetaTrader terminal.
#### Returns
#### Returns:
| Type | Description |
|--------------|-------------------------------------|
| `MetaTrader` | An instance of the MetaTrader class |
@@ -621,4 +622,4 @@ Call without parameters. Return closed deals on all symbols
#### Returns
| Type | Description |
|--------------------|----------------------------------------------------|
| `tuple[TradeDeal]` | A tuple of closed trade deals as TradeDeal objects |
| `tuple[TradeDeal]` | A tuple of closed trade deals as TradeDeal objects |