stop loss

Trailing Stops in MQL5: Filter Positions and Respect Broker Constraints

Trailing Stops in MQL5: Filter Positions and Respect Broker Constraints

Technical revision: 1 October 2026 · Educational materialOn this pageManage only the positions you ownDefine activation, distance and minimum improvementUse the downloadable managerCheck constraints before modifyingCompare exits, not selected success storiesA trailing stop changes the requested exit level after price moves in favor of a position. It changes the distribution of exits; it does not prove that a strategy has an edge. Compare it with a fixed-stop baseline using the same entries, costs and validation periods. Manage only the positions you own Iterating over all account positions while using the chart symbol's prices can modify an unrelated trade. The example…
Read More
Risk Management in MQL5: Position Sizing and Broker-Valid Stops

Risk Management in MQL5: Position Sizing and Broker-Valid Stops

Technical revision: 1 October 2026 · Educational materialOn this pageEstimate entry-to-stop loss in account currencyRound down and reject oversize minimumsRound prices on the tick gridAccount risk is broader than one stopPosition sizing should translate an explicit loss estimate into a broker-valid volume. It should also know when no valid order fits the budget. A stop defines a requested exit condition; it cannot guarantee the realized loss when execution gaps or costs differ from the estimate. Estimate entry-to-stop loss in account currency Using a fixed pip value can fail across symbols, contract types and account currencies. The helper uses OrderCalcProfit at…
Read More