Lot Size Auditor
A lot size that was valid the moment an order opened can go stale later. Brokers do change MODE_LOTSTEP, MODE_MINLOT and MODE_MAXLOT on live symbols, and a manually typed size can miss the broker's lot grid entirely from the start. Neither shows up anywhere in the terminal's normal display - the Trade tab just shows the lot size, not whether it is still valid against the symbol's current specification. This EA scans open positions on a timer and reports both problems explicitly, plus a third: whether the position's stop-loss, if it has one, implies more risk than a chosen percentage of account balance. Risk is computed from MODE_TICKVALUE and MODE_TICKSIZE for the position's own symbol, never a hardcoded contract size. A hardcoded 100000-unit assumption is wrong the moment the symbol is gold, an index, or anything that is not a textbook 100k-lot FX pair, and would misreport risk exactly on the instruments where getting it wrong matters most. Notes and limitations - A position with no stop-loss is flagged as NO-STOP for visibility, not because the EA assumes every trade needs one - risk percentage cannot be computed without a stop, so this is an informational flag, not a risk figure. - Risk percentage depends on the broker reporting the tick value and tick size correctly for the symbol (MODE_TICKVALUE/MODE_TICKSIZE on MQL4, SYMBOL_TRADE_TICK_VALUE/SYMBOL_TRADE_TICK_SIZE on MQL5); if either reads back as zero, the ticket is flagged TICKVALUE-UNAVAILABLE instead of showing a wrong number. - This EA is entirely read-only. It never opens, closes or modifies a trade, and never adjusts a lot size or a stop - it only reports.
Expert advisor · MT4 · v1.0 · Free
About Lot Size Auditor
Lot Size Auditor is a script for MetaTrader 4. It has 5 settings, such as Max risk percent per trade, Symbol only and Magic filter. MQL source code included.
Files in the download: LotAuditor.ex4, LotAuditor.mq4, LotAuditor.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Max risk percent per trade | 5.0 | Flag a position if its SL implies more risk than this % of balance |
| Symbol only | false | Only audit positions on this chart's symbol |
| Magic filter | 0 | Only audit this magic number (0 = all) |
| Scan interval sec | 30 | Seconds between scans |
| Csv file name | LotAuditor_Report.csv | Report file, in MQL4\Files |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Grid · Risk & Lot Size · MT4 Expert Advisor · MQL4 Source Code