Skip to content
All library documents

Broker Symbol Specs and Minimum Legal Stop Distances

Article MQL5 code base

Summary

This document describes a broker-specification inspector that reports trading parameters for symbols available in Market Watch, including tick and contract details, volume limits, spreads, execution mode, swaps, and margin for a minimum lot. Its main practical lesson is to account for broker stop and freeze levels when placing stops or pending orders, since orders too close to the current price may be rejected.

It estimates an effective minimum distance from the larger of the reported stop and freeze levels, with a one-point buffer, then adjusts a requested stop loss outward when necessary and normalizes it to the symbol’s digits. An example applies the rule to an ATR-based stop. The document provides illustrative output and code, but no comparative testing or evidence that the estimate covers every broker’s order rules. Symbols need at least one received tick for their specifications to be available.

Key ideas

  • Broker symbol specifications include trading costs, volume constraints, execution settings, and margin requirements.
  • Stop and freeze levels constrain how close orders can be placed to the market.
  • The example adds a one-point buffer to the larger of the stop and freeze levels.
  • A requested stop loss can be moved outward to meet the estimated legal distance.
  • A symbol may need to receive a tick before its specifications are available.

Tags

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