Loading…

Spread Monitor With History

Spread is easy to check once, but hard to watch continuously - most traders only notice it widened after a bad fill. This indicator plots the spread recorded on every bar as a subwindow histogram and keeps a running minimum, average and maximum over a configurable lookback, shown in a corner label alongside the current reading. It reads the spread[] array MetaTrader already passes into every OnCalculate call - the exact spread value that was current the moment each bar closed - rather than polling MarketInfo(..., MODE_SPREAD) on a separate timer. That was a deliberate choice: the plotted history and the spike-alert logic are guaranteed to agree, because they read the same numbers, and no extra timer or tick-store bookkeeping is needed. A spike alert fires once, on bar close, the first time the closed bar's spread reaches InpSpikeMultiplier times the running average - useful for noticing a broker widening spreads around news or in thin liquidity before placing an order into it. Notes and limitations - Spread is plotted in broker points, not pips - on a 3 or 5 digit symbol, divide by 10 to read pips. - Statistics and the spike check use spread as recorded per bar in MetaTrader's own history, not a continuous tick-by-tick spread feed, so an extremely brief intrabar spike that closed back down before the bar finished may not be captured. - The spike check runs once per closed bar, matching how alerts are throttled across this catalogue, not on every tick. - Purely informational: it does not block, delay or modify any order.

Indicator · MT4 · v1.0 · Free

About Spread Monitor With History

Spread Monitor With History is an indicator for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 3 settings, such as Session bars, Spike multiplier and Alerts. MQL source code included.

Files in the download: SpreadMonitor.ex4, SpreadMonitor.mq4, SpreadMonitor.txt.

Settings

SettingDefaultWhat it does
Session bars500Bars included in the running min/avg/max stats
Spike multiplier3.0Spread this many times the running average counts as a spike
AlertstrueAlert once per closed bar on a spread spike

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: Alerts · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria