Weekend Gap Marker
A weekend gap is easy to see once and easy to forget was ever there once the chart scrolls on. This indicator finds every one in the visible history and marks it permanently: a dashed line at Friday's (or the last trading day's) close, a solid ray from Monday's (or the next trading day's) open, and a text label stating the gap size in pips and direction. Detection is generic rather than calendar-based - it measures the time distance between two consecutive bars and treats anything past InpMinGapHours as a break in the feed. That means it also catches single symbol exchange holidays and thin low-liquidity closures that leave the same shape of hole in the data, not only the Friday-to-Monday case, without hard-coding day-of-week assumptions that break the moment a broker's own trading calendar differs slightly from the textbook week. The size filter (InpMinGapPips) exists because plenty of "gaps" measured in raw price are a fraction of a pip and not worth marking - only breaks that actually moved the market get a line. Notes and limitations - Pip conversion accounts for 3 and 5 digit quotes via MODE_DIGITS, so the pip threshold behaves consistently across brokers with different price precision. - Only ever evaluates fully closed bars; the still-forming current bar (index 0) is never checked or marked, so nothing here can repaint. - On a symbol whose broker calendar has frequent short closures (some indices, some crypto pairs), InpMinGapHours may need raising or lowering to match that symbol's normal bar spacing - the default assumes a standard 5-day forex week. - Chart object count is bounded by InpMaxMarkers, not by history length; on a very long history only the most recent InpMaxMarkers gaps stay drawn.
Indicator · MT4 · v1.0 · Free
About Weekend Gap Marker
Weekend Gap Marker is an indicator for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 7 settings, such as Min gap hours, Min gap pips and Gap up color. MQL source code included.
Files in the download: WeekendGap.ex4, WeekendGap.mq4, WeekendGap.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Min gap hours | 20.0 | Minimum time gap between bars to count as a break, hours |
| Min gap pips | 3.0 | Minimum price gap to draw, pips (filters near-zero gaps) |
| Gap up color | clrLime | Line/label colour for a gap up |
| Gap down color | clrRed | Line/label colour for a gap down |
| Line width | 1 | Line width |
| Max markers | 60 | Gaps kept on the chart (oldest dropped first) |
| Alerts | true | Alert once when a fresh gap forms on a newly closed bar |
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 → Indicators.
- 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 indicator from the Navigator onto a chart and adjust the settings.
Tags: Alerts · MT4 Indicator · MQL4 Source Code