Stop Loss Coverage Audit
A missing stop loss on a runaway move can destroy an account in a single tick. A stop placed inside the broker's minimum distance from price cannot be filled by order type - it simply sits dormant until price moves far enough away, and then activates, sometimes at a catastrophic slippage. A stop placed too far away is equally useless because it violates the trader's own risk rules. If you are willing to risk at most 2% per trade, a stop three times wider than that makes the position a violation in code, not in reality. This script runs through every open position and checks three conditions: 1. Stop loss exists and is not zero. 2. Stop is far enough from current price to satisfy the broker's freeze level. 3. Stop is tight enough to keep the risk within your configured tolerance. Any position that violates any condition is flagged with the specific reason and the numbers. Notes and limitations - Only open market positions are audited. Pending orders are ignored on both platforms (MQL5 does this structurally, as explained above; MQL4 filters them out explicitly). - Risk is calculated as (price-to-stop x money-per-point x volume) and compared to account equity at this moment. Prices move constantly, so the risk figures are a snapshot. - Freeze level is read from the broker's symbol specifications. Some brokers do not publish it or change it according to session or liquidity. - A stop inside the freeze level is flagged because the broker may not fill it at the desired price - it waits until price moves far enough away first. - This script does not move or modify stops on either platform. It reports only.
Script · MT5 · v1.0 · Free
About Stop Loss Coverage Audit
Stop Loss Coverage Audit is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 2 settings, such as Max risk percent equity and Alert on finding. MQL source code included.
Files in the download: StopLossCoverageAudit.ex5, StopLossCoverageAudit.mq5, StopLossCoverageAudit.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Max risk percent equity | 2.0 | Max risk per trade as % of equity |
| Alert on finding | true | Alert when issues are found |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Alerts · MT5 Script · MQL5 Source Code