2023-11-14 03:24:47 +01:00
|
|
|
## <a id="ram"></a> Risk Assessment and Management
|
2023-10-11 09:49:06 +01:00
|
|
|
|
|
|
|
|
```python
|
|
|
|
|
class RAM()
|
|
|
|
|
```
|
2023-11-14 03:24:47 +01:00
|
|
|
### \_\_init\_\_
|
2023-10-11 09:49:06 +01:00
|
|
|
|
|
|
|
|
```python
|
|
|
|
|
def __init__(**kwargs)
|
|
|
|
|
```
|
|
|
|
|
Risk Assessment and Management. All provided keyword arguments are set as attributes.
|
|
|
|
|
|
2023-11-14 03:24:47 +01:00
|
|
|
#### Parameters
|
|
|
|
|
| Name | Type | Description | Default |
|
|
|
|
|
|----------------|------|-------------------------------------------------------|---------|
|
|
|
|
|
| risk_to_reward | float | Risk to reward ratio | 1|
|
|
|
|
|
| risk | float | Percentage of account balance to risk per trade | 0.01 # 1%|
|
|
|
|
|
| amount | float | Amount to risk per trade in terms of account currency | 0|
|
|
|
|
|
| **kwargs** | Dict | Keyword arguments to be set as object attributes | {} |
|
2023-10-11 09:49:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
<a id="aiomql.ram.RAM.get_amount"></a>
|
|
|
|
|
|
2023-11-14 03:24:47 +01:00
|
|
|
### get\_amount
|
2023-10-11 09:49:06 +01:00
|
|
|
|
|
|
|
|
```python
|
|
|
|
|
async def get_amount(risk: float = 0) -> float
|
|
|
|
|
```
|
|
|
|
|
Calculate the amount to risk per trade as a percentage of free margin.
|
|
|
|
|
|
2023-11-14 03:24:47 +01:00
|
|
|
#### Parameters
|
|
|
|
|
| Name | Type | Description | Default |
|
|
|
|
|
|----------------|------|-------------------------------------------------------|---------|
|
|
|
|
|
| risk | float | Percentage of account balance to risk per trade | 0.01 # 1%|
|
2023-10-11 09:49:06 +01:00
|
|
|
|
2023-11-14 03:24:47 +01:00
|
|
|
#### Returns
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
|
|----------------|------|-------------------------------------------------------|
|
|
|
|
|
| amount | float | Amount to risk per trade in terms of account currency |
|