mirror of
https://github.com/Ichinga-Samuel/aiomql.git
synced 2026-07-28 12:47:43 +00:00
3.4 KiB
3.4 KiB
Risk Assessment and Management
Table of Contents
RAM
class RAM
Risk Assessment and Management. You can customize this class based on how you want to manage risk.
Attributes:
| Name | Type | Description | Default |
|---|---|---|---|
account |
Account |
The account object | Account() |
risk_to_reward |
float |
Risk to reward ratio | 2 |
risk |
float |
Percentage of account balance to risk per trade | 1% |
fixed_amount |
float |
A fixed amount to risk per trade | |
min_amount |
float |
Minimum amount to risk per trade | |
max_amount |
float |
Maximum amount to risk per trade | |
loss_limit |
int |
Number of open losing trades to allow at any time | 3 |
open_limit |
int |
Number of open trades to allow at any time | 3 |
__init__
def __init__(self, **kwargs):
Risk Assessment and Management. All provided keyword arguments are set as attributes.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
kwargs |
dict |
Keyword arguments to be set as instance attributes | {} |
ram.get_amount
async def get_amount() -> float
Calculate the amount to risk per trade as a percentage of balance.
Returns:
| Type | Description |
|---|---|
float |
Amount to risk per trade in terms of account currency |
check_losing_positions
async def check_losing_positions(self) -> bool:
Check if the number of open losing trades is greater than or equal to the loss limit.
Returns:
| Type | Description |
|---|---|
bool |
True if the number of open losing trades is more than the loss limit, False otherwise |
check_open_positions
async def check_open_positions(self) -> bool:
Check if the number of open positions is less than or equal the loss limit.
Returns:
| Type | Description |
|---|---|
bool |
True if the number of open losing trades is more than the loss limit, False otherwise |
modify_ram
def modify_ram(**kwargs):
Modify the RAM attributes. All provided keyword arguments are set as attributes.