Files
aiomql/docs/ram.md
T
Ichinga Samuel 027f9fd8de add docs
2023-10-11 09:49:06 +01:00

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:

  • kwargs Dict - Keyword arguments.

    Defaults:

  • 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

  • pips float - Target pips 0

  • volume float - 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:

  • risk float - 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:

  • symbol Symbol - Financial instrument

Arguments:

  • pips float - Target pips. Defaults to zero.
  • amount float - Amount to risk per trade. Defaults to zero.

Returns:

  • float - Volume to trade