Skip to content
All library documents

Calculating Maximum Position Size from Available Margin

Article MQL5 code base

Summary

This document describes an Expert Advisor that estimates the largest lot size that could be used to open a position with the deposit’s available free margin. It displays the calculated size in a chart corner. A position type input lets the user select buy or sell, while other inputs control the label’s appearance and placement.

The document provides no calculation formula, worked example, performance evidence, or discussion of how the estimate handles broker-specific margin rules, leverage, or changing prices. It therefore explains the tool’s purpose and configurable display, but not enough detail to assess its accuracy or use it as a standalone position-sizing method. A maximum-margin estimate also does not establish an appropriate risk limit: using all free margin can leave little capacity to absorb losses or margin changes.

Key ideas

  • The Expert Advisor estimates the maximum lot size that available free margin can support.
  • The result is displayed on the chart, with configurable position type and label settings.
  • The document does not explain the calculation or provide accuracy or performance evidence.
  • A maximum-margin estimate is not itself a risk-based position-sizing recommendation.

Tags

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