The cap channel trading indicator builds a channel and then measures where price sits inside it. A 34-bar average carries the midline. The rails hang `InpRailMult` volatility units either side, from ATR or from standard deviation as you choose. Entries look for a rail pierced and rejected.
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 | 5: Channel Mid, Channel Upper, Channel Lower, Channel Buy, Channel Sell |
| Alerts | popup, push notification, email, sound |
| Inputs | 23 |
What the Cap Channel Trading Indicator draws on the chart
Channel Mid is the goldenrod midline.
Channel Upper and Channel Lower are the deep sky blue rails.
Channel Buy and Channel Sell mark bars that pierced a rail and closed back inside.
A corner panel reports the channel position as a percentage, plus rail prices and width.
- Channel Mid: line, goldenrod, width 2
- Channel Upper: line, deep sky blue, width 1
- Channel Lower: line, deep sky blue, width 1
- Channel Buy: arrow, lime green, width 3, arrow code 233
- Channel Sell: arrow, tomato, width 3, arrow code 234

How the Cap Channel Trading Indicator calculates its values
Setting the midline
iMA supplies the average at `InpMaPeriod` `34`, using `InpMaMethod` and `InpMaPrice`. Reading the built-in average avoids a hand-rolled recursion, so the line has no warmup hole. Both method and price are yours to change.
Choosing what the rails measure
`InpRailMode` picks between ATR and standard deviation. w then takes `InpRailMult` `2.00` times whichever one you chose. ATR follows true range and counts gaps. Standard deviation follows how far closes scatter around the mean. Either way the channel breathes with volatility.
Judging an entry
A buy needs the bar low below the lower rail and the close back above it, on an up bar. The sell case mirrors that at the upper rail. `InpRequireSide` also demands the close stay on its own side of the midline. `InpMinGap` `5` blocks repeat triggers on one excursion.
How to read the signals
Channel position at 0 percent means price sits on the lower rail.
Above 100 percent or below 0 percent means price has left the channel entirely.
The width figure in the panel tells you how much room the current volatility allows.
An arrow means a rejection, so it points back toward the midline.
Alert channels in this build: popup, push notification, email and sound, one message per closed bar.
`EnableAlerts` ships on and `EnablePopup` carries the message. `EnablePushNotify`, `EnableEmail` and `EnableSound` stay off by default. `SoundFile` names the clip. Entries are judged on closed bars, and the guard allows one message per bar.
Every Cap Channel Trading Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
InpMaPeriod |
Midline period. Bars in the midline average, default `34`. | 34 |
InpMaMethod |
Midline method. Averaging method for the midline, default MODE_EMA. | MODE_EMA |
InpMaPrice |
Midline applied price. Applied price for the midline, default PRICE_CLOSE. | PRICE_CLOSE |
InpRailMode |
Rail width source. Source of the rail half-width, default RAIL_ATR. | RAIL_ATR |
InpRailMult |
Rail half-width multiplier. Rail half-width multiplier, default `2.00`. | 2.00 |
InpAtrPeriod |
ATR period (RAIL_ATR). ATR length when the rails use ATR, default `14`. | 14 |
InpStdPeriod |
StdDev period (RAIL_STDDEV). Deviation length when the rails use scatter, default `34`. | 34 |
InpRequireSide |
Close must stay on its own side of the midline. Keeps the close on its own side of the midline, default `true`. | on |
InpMinGap |
Minimum bars between arrows (buffer-scanned). Bars enforced between arrows, default `5`. | 5 |
Display settings
| Setting | What it does | Default |
|---|---|---|
InpArrowOffset |
Arrow distance from the bar (x rail half-width). Arrow distance as a share of rail half-width, default `0.55`. | 0.55 |
InpLabelBars |
Draw BUY/SELL text within N bars. How far back text labels are drawn, default `400` bars. | 400 |
InpMaxLabels |
Hard cap on text objects. Hard cap on text objects, default `150`. | 150 |
InpShowPanel |
Show channel-position panel. Draws the channel position panel, default `true`. | on |
InpPanelCorner |
0=UL 1=UR 2=LL 3=LR. Panel corner, default `0` for upper left. | 0 |
InpPanelX |
Panel X offset. Panel horizontal offset, default `12`. | 12 |
InpPanelY |
Panel Y offset (clears one-click panel). Panel vertical offset, default `120` so it clears the trade panel. | 120 |
InpPanelBg |
Panel background. Panel background colour, default black. | black |
Alert settings
| Setting | What it does | Default |
|---|---|---|
EnableAlerts |
Switches the channel alerts on as a group, default `true`. | on |
EnablePopup |
Raises the terminal dialog on a rail rejection, default `true`. | on |
EnablePushNotify |
Sends the rejection to your phone, default `false`. | off |
EnableEmail |
Mails the rejection through the terminal, default `false`. | off |
EnableSound |
Plays a file on a rail rejection, default `false`. | off |
SoundFile |
Name of the wav file the channel alert uses, default `alert.wav`. | alert.wav |

Settings that fit your chart
Rail rejections belong to markets that oscillate rather than run. EURUSD H1 is the reference chart, where `InpMaPeriod` at `34` covers about a day and a half. On M5 the rails move quickly and rejections come often. On H4 each excursion to a rail is a session-sized move.
When the Cap Channel Trading Indicator fails
A mean-reversion entry in a trend fights the trend. That is the standing risk with any rail rejection.
ATR and deviation give different rails. Switching `InpRailMode` changes which bars qualify.
The channel position figure is meaningless while the rails are still warming up.
Copy the compiled Cap Channel Trading 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.
Related on forexmt4systems.com: Range Trading Strategy.
Background reading on the method behind the Cap Channel Trading Indicator: Reference data (financial markets) on Wikipedia, Renko Charts at StockCharts ChartSchool.
Download the Cap Channel Trading Indicator for MT4 and MT5
The zip holds the compiled Cap Channel Trading 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.
FAQ
What does InpRailMode change about the rails?
Which volatility measure sets their width. RAIL_ATR uses average true range, which counts gaps and follows the whole bar. The other setting uses the standard deviation of price around the mean. ATR rails tend to sit wider after a gap, deviation rails after a run of scattered closes.
How is channel position calculated?
As a percentage between the two rails. The panel takes the close minus the lower rail, divides by the rail-to-rail width and multiplies by 100. Zero puts price on the lower rail and 100 on the upper. Outside that range price has left the channel.
What does InpRequireSide add to an entry?
One more condition. With it true, a buy also needs the close to stay below the midline. That keeps entries pointed back toward the mean instead of chasing a bar that already crossed it. Set it false for a looser rule.
Why does the Channel Buy arrow need an up bar?
Because the setup is a rejection, not a break. The low has to pierce the lower rail, the close has to come back inside, and the bar itself has to close higher than it opened. Together those three describe buyers taking the bar back.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Cap Channel Trading Indicator as one input. Always backtest before trading live.
External references
- For background on this concept, see Reference data (financial markets) on Wikipedia.
- For broader market context, see Renko Charts at StockCharts ChartSchool.
