Candle Overlay Indicator: H4 Candles On Your H1 Chart

Written by Dominic Walsh · Published · Last updated

The candle overlay indicator saves you switching charts. It rebuilds the last twelve candles of a higher timeframe as real candle shapes and draws them over your current chart. The intraday bars keep ticking underneath.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Main price chart
Plots 0
Alerts popup, push notification, email, sound
Inputs 23

What the Candle Overlay Indicator draws on the chart

Rectangles outline each higher-timeframe body, bull in deep sky blue and bear in orange red.

Two trend segments per candle form the wick above and below the body.

`InpShowSeparators` adds a dotted line at every higher-timeframe open.

`InpShowHiLo` extends the last closed candle’s high and low to the right.

Candle overlay indicator higher-timeframe candles drawn over the EURUSD H1 chart.
Candle overlay indicator higher-timeframe candles drawn over the EURUSD H1 chart.

How the Candle Overlay Indicator calculates its values

Reading the higher timeframe

The code asks the terminal for the open, high, low and close of each `InpHTF` `PERIOD_H4` candle. A guard checks the history arrived before it draws.

Two objects make a candle

A rectangle spans the body from open to close. Two segments draw the wick, one above the body and one below. Splitting the wick is what makes the shape read as a candle.

Objects get reused, not recreated

Names are index based, so `InpCount` `12` caps the object count exactly. Each rebuild moves those objects rather than making new ones. That is why the overlay stays cheap.

How to read the signals

Outlines rather than fills keep your own candles readable underneath.

Separators group your bars into their parent candles.

Extended high and low mark the range the higher chart trades between.

The newest overlay candle still forms, so its shape will change.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

`EnableAlerts` governs four routes and starts true with `EnablePopup`. `EnablePushNotify` reaches a phone, `EnableEmail` sends mail and `EnableSound` plays `SoundFile`, all three off by default. The message fires when a higher-timeframe candle completes.

Every Candle Overlay Indicator input

Core settings

Setting What it does Default
InpHTF Higher timeframe to overlay. Timeframe to overlay, default `PERIOD_H4`. PERIOD_H4
InpCount Higher-TF candles to draw (2..60). Higher-timeframe candles to draw, default `12`. 12
InpFillBody Fill the body (false = outline, recommended). Fill the body instead of outlining it, default `false`. off
InpBackground Draw behind the price bars. Draw behind your price bars, default `false`. off

Display settings

Setting What it does Default
InpBullColor Bull candle colour. Outline colour for an up candle, default `clrDeepSkyBlue`. deep sky blue
InpBearColor Bear candle colour. Outline colour for a down candle, default `clrOrangeRed`. orange red
InpBodyWidth Body outline width. Thickness of the body outline, default `2`. 2
InpWickWidth Wick width. 1
InpShowSeparators Dotted line on every higher-TF open. Dotted line at every higher-timeframe open, default `true`. on
InpSepColor Separator colour. dim gray
InpShowHiLo Extend last closed higher-TF high/low. Extend the last closed high and low, default `true`. on
InpShowTag Price tag on the last closed candle. Price tag on the last closed candle, default `true`. on
InpPanelCorner Panel corner 0=UL 1=UR 2=LL 3=LR. 0
InpPanelX Panel X offset (px). 12
InpPanelY Panel Y offset (px, clears one-click panel). 120
InpPanelBg Panel background. RGB 10,16,22
InpFontSize Panel font size. 9

Alert settings

Setting What it does Default
EnableAlerts (see inputs panel) on
EnablePopup (see inputs panel) on
EnablePushNotify (see inputs panel) off
EnableEmail (see inputs panel) off
EnableSound (see inputs panel) off
SoundFile (see inputs panel) alert.wav
Candle overlay indicator inputs panel with InpHTF, InpCount and InpFillBody.
Candle overlay indicator inputs panel with InpHTF, InpCount and InpFillBody.

Settings that fit your chart

The pairing is what matters. EURUSD H1 with `InpHTF` at H4 is the reference setup. Twelve candles cover two days there. Go three steps up and the candles get too wide for the screen.

When the Candle Overlay Indicator fails

A crowded chart gets busier, since every overlay candle adds three objects.

`InpFillBody` `true` hides your own bars, which is why it ships off.

The forming higher-timeframe candle changes shape until it closes.

Copy the compiled Candle Overlay Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Background reading on the method behind the Candle Overlay Indicator: Currency overlay on Wikipedia, Arms Candlevolume at StockCharts ChartSchool.

Download the Candle Overlay Indicator for MT4 and MT5

The zip holds the compiled Candle Overlay Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

What would InpFillBody hide if switched on?

The lower-timeframe bars sitting inside each overlay candle, which defeats the purpose. An outline shows the higher structure while leaving your own candles fully readable underneath.

What does InpCount 12 cap?

Both how far back the overlay reaches and how many chart objects exist. Twelve H4 candles is two days on an H1 chart. Each candle adds three objects, so the count climbs quickly.

What do the InpShowHiLo levels mark?

The high and low of the last completed higher-timeframe candle, extended right. Those two prices are the range the higher chart works inside, which is often where reactions happen.

Why does InpBodyWidth still show a doji?

A rectangle with zero height would render as nothing at all. The code widens a doji body by half a point so the outline stays visible, which keeps the candle shape honest on screen.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Candle Overlay Indicator as one input. Always backtest before trading live.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment