Voir comment télécharger gratuitement des robots de trading
Retrouvez-nous sur Twitter !
Rejoignez notre page de fans
Un script intéressant ?
Poster un lien vers celui-ci -
laisser les autres l'évaluer
Vous avez aimé le script ? Essayez-le dans le terminal MetaTrader 5
Indicateurs

Spread Monitor Alert - indicateur pour MetaTrader 5

Cristhian Alexander Gaibor Cuasquer
Cristhian Alexander Gaibor Cuasquer
4.7 (40)
Trader et membre de MQL5 depuis 2017.
Vues:
126
Note:
(1)
Publié:
MQL5 Freelance Besoin d'un robot ou d'un indicateur basé sur ce code ? Commandez-le sur Freelance Aller sur 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.

TradeDiagnostics - include file that explains why an EA cannot open a trade TradeDiagnostics - include file that explains why an EA cannot open a trade

One function call checks the terminal, account, program permission, symbol, trading session, quotes, spread, volume and margin, and tells you in plain words why a new trade cannot be opened. No order is ever sent.

Broker Time Panel - server clock, local zone, measured offset, candle close countdown Broker Time Panel - server clock, local zone, measured offset, candle close countdown

The panel prints the broker's server clock, your local clock with its GMT zone, the offset between the two to the minute, and the countdown to the close of the chart's current candle. The offset is measured from the terminal's own clocks on every pass, so nothing is typed in and no broker zone is assumed. If you set a lead in seconds and enable a channel, it sends one alert per candle while a bid is available, with the seconds left and the bid; its eight objects stay out of the object list and cannot be selected.