This commit is contained in:
Ichinga Samuel
2026-02-27 04:11:38 +01:00
parent cb2c700752
commit eed7e80c0d
15 changed files with 430 additions and 78 deletions
+7 -8
View File
@@ -1,11 +1,11 @@
# forex_symbol
`aiomql.contrib.symbols.forex_symbol` — Forex-specific symbol with pip calculations.
`aiomql.contrib.symbols.forex_symbol` — Forex-specific symbol with pip and volume calculations.
## Overview
Extends [`Symbol`](../../lib/symbol.md) with forex-specific logic for pip size,
pip value, and volume calculations based on currency pairs.
Extends [`Symbol`](../../lib/symbol.md) with forex-specific logic for pip size
and volume calculations based on price movements and stop-loss levels.
## Classes
@@ -17,13 +17,12 @@ Inherits from [`Symbol`](../../lib/symbol.md).
| Attribute | Type | Description |
|-----------|------|-------------|
| `pip` | `float` | Pip size for the pair |
| `pip` | `float` | Pip size for the pair (`point * 10`) |
#### Methods
| Method | Returns | Description |
|--------|---------|-------------|
| `pip_value(volume)` | `float` | Value of one pip for a given lot size |
| `pips_to_price(pips)` | `float` | Converts a pip count to a price delta |
| `price_to_pips(price_delta)` | `float` | Converts a price delta to pips |
| `calc_volume(amount, pips)` | `float` | Calculates lot size from risk amount and pip distance |
| `compute_points(amount, volume)` | `float` | Computes points of price movement needed for a given amount and volume |
| `compute_volume_points(amount, points, round_down=False)` | `float` | Computes lot size from risk amount and point distance |
| `compute_volume_sl(amount, price, sl, round_down=False)` | `float` | Computes lot size from risk amount, entry price, and stop-loss price |