Watch how to download trading robots for free
Find us on Telegram!
Join our fan page
Interesting script?
So post a link to it -
let others appraise it
You liked the script? Try it in the MetaTrader 5 terminal
Indicators

Spread Monitor Alert - indicator for MetaTrader 5

Cristhian Alexander Gaibor Cuasquer
Cristhian Alexander Gaibor Cuasquer
  • Founder & Systems Engineer at  Xander Pro
  • Ecuador
  • 9563
4.7 (40)
Trader and MQL5 member since 2017.
Views:
58
Rating:
(1)
Published:
MQL5 Freelance Need a robot or indicator based on this code? Order it on Freelance Go to Freelance

On Gold (XAUUSD) the spread can jump from 15 to 50 points around news or the daily rollover, and an order sent at that moment starts far behind. This indicator reads the spread of the symbol on every tick and once per second and shows it in a small panel: the spread now, the average of the last 300 samples and the highest spread of the server day with the time it happened.

The last line says NORMAL or WIDE. Wide means above your fixed limit in points, or, when you leave the limit at 0, above twice the average once enough samples are in. An optional alert fires the moment the spread opens above the limit, with a pause so it does not repeat on every tick.

The indicator only measures, it does not block any order. The average starts again every time you load it, so give it a few minutes before you trust the automatic limit.

Spread Monitor Alert on a XAUUSD M5 chart in MetaTrader 5: panel with the spread now, the average, the highest of the day and the normal or wide status

Settings

  • Fixed limit: in points, default 0, which means the automatic limit.
  • Wide factor: 2.0, the automatic limit is the average times this, and it starts after a tenth of the samples are in.
  • Samples in the average: 300, one per tick or per second.
  • Panel: distance from the left and top edge in pixels, font size, background, text, normal and wide colours.
  • Alerts: when the spread opens above the limit, off by default, with a pause of 60 seconds before it can fire again. Popup, push and sound.
  • Object prefix: change it to run two copies on the same chart.

What it needs

Any symbol and any timeframe. It reads the spread the terminal reports for the symbol, or ask minus bid when that is 0. The panel is a flat rectangle with plain text labels in the upper left corner, it has no buffers and it never trades. Push notifications need your MetaQuotes ID in the terminal options.

Make it yours

Run it on XAUUSD, XAGUSD, EURUSD, GBPUSD, US30 or NAS100 and write down the spread at the London and New York opens and at the rollover for a week, it tells you when your broker is expensive. The same check is the first filter many EAs need before they send an order next to Smart Money Concepts or support and resistance entries. XP_Sample and XP_Limit are short functions you can copy into your EA as a spread filter.

About this code

Open source. Use it as it is, adapt it, build your own version on top of it. Questions, suggestions and your own tests are welcome in the comments below. Provided as is, use at your own risk.

Related: News Straddle EA Economic Calendar, Daily Loss and Profit Lock, Candle Timer Countdown, Multi Timeframe Trend Dashboard.

Changelog

v1.0 (2026-12-05): initial release.

Pivot Points Daily Weekly Monthly Pivot Points Daily Weekly Monthly

Pivot points for Gold (XAUUSD) and any symbol on MT5. Classic or Fibonacci P, R1 to R3 and S1 to S3 from the previous day, week or month, one set per period, with an optional alert when a candle closes across a level. Open source code.

ATR Stop Loss Take Profit Levels ATR Stop Loss Take Profit Levels

ATR stop loss and take profit levels for Gold (XAUUSD) and any symbol on MT5. Draws the stop and two targets from the ATR for a buy at the ask and a sell at the bid, with the lot for your risk in percent of the balance. Open source code.

Accelerator Oscillator (AC) Accelerator Oscillator (AC)

The Acceleration/Deceleration Indicator (AC) measures acceleration and deceleration of the current driving force.

MACD Signals MACD Signals

Indicator edition for new platform.