Skip to content
All library documents

Position Sizing from Account Risk and Stop-Loss Distance

Article MQL5 code base

Summary

The document describes a lot-size calculator that limits trade risk to a chosen fraction of available account funds. It measures the risk distance from the entry price to an emergency stop in pips and uses pip value, expressed in the account’s main currency, to translate that distance into a position size. The example settings use a risk fraction in the low single digits and show sample EURUSD and USDJPY calculations, including a stated lot-size result for each scenario.

The tool can use actual free margin or a simulated balance, and its inputs include stop distance and the fraction of funds to risk. The text does not show the formula clearly in the extracted material, nor does it discuss gaps, slippage, commissions, changing pip values, or whether the stop will execute at its specified price. The calculator’s output should therefore be understood as a basic planned-risk estimate under its stated assumptions.

Key ideas

  • The calculator sizes a position using account funds, the chosen risk fraction, stop distance in pips, and pip value.
  • Risk is defined by the distance between entry and emergency stop-loss prices.
  • The account balance input can use actual free margin or a simulated amount.
  • The examples report lot sizes for EURUSD and USDJPY under specified balances and stop distances.
  • The text does not account for execution slippage or other costs that can change realized risk.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.