Join our fan page
Leverage Monitor – Real Leverage, Margin Tiers, Swap, Commission and Spread - expert for MetaTrader 5
- Views:
- 117
- Rating:
- Published:
-
Need a robot or indicator based on this code? Order it on Freelance Go to Freelance
Know what your broker is really giving you
Account leverage of 1:500 says little about the leverage you get on each symbol. Brokers use different margin rates per instrument, and many reduce leverage as position size grows. Leverage Monitor puts the real numbers for every symbol in your Market Watch into one compact panel on your chart.
It is a non-trading tool. It never places, modifies or closes orders.
What you see
| Column | What it shows |
|---|---|
| Symbol | Every symbol in your Market Watch |
| Type | Margin calculation mode (FX, CFD, INDEX, STOCK, FUT) |
| Leverage | Effective leverage, coloured green or red when it changes |
| Tiers (by volume) | Floating margin tiers, e.g. 500 > 200 > 100 , with the volume where each tier starts |
| Swap (long / short) | Overnight swap from the symbol specification |
| Commission | Commission rules from the symbol specification |
| Spread (now / 1h avg) | Current spread and the average of the last hour, in points |
| History | Mini chart of leverage or spread over time, one point per minute by default |
Key features
- Tier-aware leverage. Detects floating margin rates and shows the leverage of each volume tier. Hover a row to read the tiers in full on the bottom line.
- Specification-based values. Leverage, swap and commission are read from the symbol specification, not guessed from price.
- Change tracking. Leverage history is stored per symbol and kept between sessions, so you can see when your broker changed margin requirements.
- Spread monitor. Shows current spread against the one-hour average.
- Chart switch. One button toggles the history column between leverage and spread.
- Tooltips everywhere. Text is never allowed to overlap. Long text is cut with “...” and the full text appears in a tooltip. Swap, commission, spread and history cells give extra detail on hover.
- Fully adjustable panel:
- Zoom with the A- / A+ buttons
- Drag column borders to change widths
- Resize with the corner grip
- Collapse to the title bar
- Sort by symbol or by leverage
- Scroll with the mouse wheel
- Settings are remembered between sessions.
How leverage is determined
| Margin mode | Method |
|---|---|
| Forex | Account leverage ÷ margin rate |
| Forex without leverage, CFD, Index, Stocks | 1 ÷ margin rate |
| CFD with leverage | Account leverage ÷ margin rate |
| Futures | Notional value ÷ initial margin |
| Tiers | The terminal’s own margin calculation is sampled at growing volumes. The change in margin per lot shows each tier’s leverage. |
Requirements
| Platform | MetaTrader 5, recent build (commission data needs SymbolInfoCommissions ) |
| Type | Expert Advisor. Attach it to its own chart. |
| Trading | None. The EA does not trade. |
| DLL / web requests | Not used |
Note: The EA must run as an Expert Advisor because margin calculation is not available to indicators.
Input parameters
| Parameter | Default | Description |
|---|---|---|
| Panel X / Y offset | 10 / 20 | Position on the chart |
| Row height / font size | 18 / 8 | Base size at zoom 100% |
| Initial visible rows | 0 | 0 = fit chart height |
| Column widths | various | Symbol, Type, Leverage, Tiers, Swap, Commission, Spread, History. All can also be dragged. |
| History chart shows spread | false | Starting mode of the history column |
| History sample interval | 60 s | One chart point per interval |
| Spec re-check interval | 5 s | How often values are refreshed |
| Tier re-scan interval | 600 s | How often margin tiers are re-scanned |
| Symbols tier-scanned per second | 3 | Limits CPU load |
| Max history points | 1440 | Per symbol (24 h at 1 per minute) |
| Persist history | true | Keep history between sessions |
| Colours | dark theme | Background, title, header, border, text, bottom info line, accent, up, down |
Good to know
- Spread averages and the spread chart start collecting when the EA is attached. The average fills in over the first hour, and spread history is not saved between sessions.
- Tier detection depends on what your broker’s server returns for margin calculations. Symbols with a single flat rate show “single tier”.
- Values shown are those of the connected account and server.
Quick start
- Open a new, empty chart.
- Drag Leverage Monitor onto it.
- Add the symbols you want to see to your Market Watch.
- Hover a row for tiers, and drag the column borders to taste.
Risk notice: This tool displays information only and is not financial advice. Check margin requirements with your broker before trading.
Prop-firm Guard - daily loss and max drawdown protection for challenge accounts
Watches the whole account and closes everything before the daily loss or max drawdown limit is breached, then keeps the account flat until the block ends. Does not trade.
Restart-Safe EA Template - no duplicate entries after a restart
Expert Advisor template that shows safe execution practices: closed-bar signals once per bar, no duplicate entries after an MT5 or VPS restart, spread and stop-level checks, normalised volume and a log line for every decision.
Prop Firm Live Daily Breach Line (OrderCalcProfit and iCustom Ready)
Real-time daily drawdown buffer monitor and exact breach price line indicator for prop firm accounts. Features 00:00 server-time deal history reconstruction (including entry commissions), 00:00 HWM snapshot locking, two-stage OrderCalcProfit cross-rate calibration, and iCustom() data buffers for Expert Advisors.
Fair Value Gaps
Non-repainting fair value gaps on closed bars, with zone states (active, touched, mitigated) and iCustom buffers for EAs.
