Thin Market Warning Banner
Thin liquidity (a half-day, a public holiday abroad, an overnight lull) widens effective spreads and makes stops and fills behave worse than normal, but there is no single feed a custom indicator can read that says "today is thin" directly. This banner infers it from what the feed already shows: current tick volume compared against this symbol's own recent average volume at the same minute-of-day bucket, and current spread compared against the recent average bar range at that same bucket as a liquidity proxy. The comparison is bucketed by time-of-day rather than compared to one flat average, because normal volume at 3am server time is nothing like normal volume during the London/New York overlap - comparing a quiet Asian-session reading against an all-day average would misfire constantly. An optional holiday CSV lets a trader pre-warn about a date known in advance to be thin (a bank holiday, a shortened session) rather than relying only on the reactive volume/spread check, which only shows up once the session is already under way. Severity is three-tier: normal, warning (volume below a configurable fraction of normal, or spread elevated versus normal range), and critical (volume far below normal, or today matches a listed holiday date). An optional single Alert() fires once per session the first time it reaches critical, rather than repeating on every tick. Notes and limitations - MT4 has no historical per-bar spread series, so the spread comparison uses each bucket's average (High-Low) range in points as a liquidity proxy rather than a true historical spread average - documented as an approximation, not an exact spread history. - The volume/spread baseline needs a few weeks of history per bucket to be meaningful; the panel says "(building volume baseline)" until then. - The holiday file is read once at OnInit and once per calendar day; a file edited mid-session is not picked up until the next day change or the indicator is reloaded. - This is a read-only warning tool; it places no orders and cannot force a strategy to stand aside, it only surfaces the condition on the chart.
Indicator · MT4 · v1.0 · Free
About Thin Market Warning Banner
Thin Market Warning Banner is an indicator for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 11 settings, such as Lookback days, Bucket minutes and Volume warn ratio. MQL source code included.
Files in the download: ThinMarketWarningBanner.mq4, ThinMarketWarningBanner.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Lookback days | 20 | Trading days of same-time-of-day history compared against |
| Bucket minutes | 30 | Width of the time-of-day bucket volume/spread are averaged into |
| Volume warn ratio | 0.40 | Warn when current bucket volume falls below this fraction of its average |
| Volume crit ratio | 0.20 | Escalate to critical below this fraction |
| Spread warn mult | 1.60 | Warn when current spread exceeds this multiple of its bucket average |
| Holiday file name | ThinMarketWarningBanner_Holidays.csv | Optional file in MQL4\Files\ (one yyyy.mm.dd per line, blank = unused) |
| Corner | 1 | Panel corner (0=TL,1=TR,2=BL,3=BR) |
| X offset | 10 | Panel horizontal offset in pixels |
| Y offset | 20 | Panel vertical offset in pixels |
| Font size | 9 | Panel text size |
| Alert on critical | true | Fire one Alert() per session when thinness turns critical |
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: Volume · Alerts · MT4 Indicator · MQL4 Source Code