mirror of
https://github.com/Ichinga-Samuel/aiomql.git
synced 2026-07-28 12:47:43 +00:00
1.7 KiB
1.7 KiB
aiomql.ram
Risk Assessment and Management
RAM Objects
class RAM()
__init__
def __init__(**kwargs)
Risk Assessment and Management. All provided keyword arguments are set as attributes.
Arguments:
-
kwargsDict - Keyword arguments.Defaults:
-
risk_to_rewardfloat - Risk to reward ratio 1 -
riskfloat - Percentage of account balance to risk per trade 0.01 # 1% -
amountfloat - Amount to risk per trade in terms of account currency 0 -
pipsfloat - Target pips 0 -
volumefloat - Volume to trade 0
get_amount
async def get_amount(risk: float = 0) -> float
Calculate the amount to risk per trade as a percentage of free margin.
Arguments:
riskfloat - Percentage of account balance to risk per trade. Defaults to zero.
Returns:
float- Amount to risk per trade
get_volume
async def get_volume(*,
symbol: Symbol,
pips: float = 0,
amount: float = 0) -> float
Calculate the volume to trade. if pips is not provided, the pips attribute is used. If the amount attribute or amount argument is zero, the amount is calculated using the get_amount method based on the risk.
Arguments:
symbolSymbol - Financial instrument
Arguments:
pipsfloat - Target pips. Defaults to zero.amountfloat - Amount to risk per trade. Defaults to zero.
Returns:
float- Volume to trade