Skip to content
All library documents

Risk-Based Lot Sizing Across Forex and Other Instruments

Article MQL5 code base

Summary

This utility calculates a position lot size from either a percentage of account equity or a fixed risk amount, using a user-entered stop distance. For forex, the tool accepts stop loss in pips and adjusts the input for five-digit broker quotes. For contracts, commodities, indices, and stocks, the stop distance is entered in points. The calculation is also described as respecting each broker's minimum and maximum lot limits.

Its alert reports the resulting lot size, risk amount, estimated loss, any converted forex stop distance, and the asset's tick size and tick value. An update addresses differences in non-forex lot calculations across brokers, illustrated by distinct US30 step sizes. The method is a sizing aid, not a trading signal: its usefulness depends on correct instrument specifications, stop distance, account risk input, and broker contract rules. The document provides no validation results or formula details, so users would need to verify calculations against their broker before relying on them.

Key ideas

  • The tool sizes positions from either a percentage risk setting or a fixed risk amount.
  • It uses a stop distance and adjusts forex pip inputs for five-digit quotes.
  • Non-forex instruments use point-based stop distances and broker-specific lot constraints.
  • The alert includes estimated loss and instrument tick specifications, which should be checked against broker data.

Tags

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