The auto trend channel indicator draws the channel a chart reader would draw. Two swing highs set the slope. The lower rail then drops to whichever swing low sits furthest from that line, so the channel contains the move.
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 | 14 |
What the Auto Trend Channel Indicator draws on the chart
A tomato upper rail runs through the two most recent swing highs.
A dodger blue lower rail runs parallel beneath it.
`ShowMidline` adds a dashed silver line halfway between them.
Every element is a chart object, since this build declares no plot buffers.

How the Auto Trend Channel Indicator calculates its values
Swings set the slope
`FractalDepth` `6` confirms a pivot with six bars either side. The two most recent swing highs give the slope, measured in price per second so it works on any timeframe.
The lower rail is chosen, not fitted
Both recent swing lows get measured against the upper rail. Whichever sits further below it becomes the anchor, so the channel wraps the whole move rather than cutting through it.
Breaks read from the closed bar
The alert compares the last completed close against both rails at that moment. `RayRight` `true` extends the channel forward so the comparison has a level to use.
How to read the signals
A channel is a description of the move so far, redrawn as swings change.
The midline often acts as the reference inside a steady trend.
`MaxSearchBars` `600` bounds how far back the pivot search goes.
Nothing appears in the data window, because no buffer carries a value.
Alert channels in this build: popup, push notification, email and sound, one message per closed bar.
`EnableAlerts` heads four routes and arrives true with `EnablePopup`. `EnablePushNotify` reaches a mobile device, `EnableEmail` posts mail and `EnableSound` plays `SoundFile`. Those three ship off. A rail break reports on the closed bar.
Every Auto Trend Channel Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
FractalDepth |
Swing half-width (bars each side). Bars either side that confirm a swing, default `6`. | 6 |
MaxSearchBars |
Bars scanned for pivots. Bars the pivot search covers, default `600`. | 600 |
RayRight |
Extend the channel to the right. Extend the channel to the right, default `true`. | on |
Display settings
| Setting | What it does | Default |
|---|---|---|
ShowMidline |
Draw the dashed channel midline. Draw the dashed centre line, default `true`. | on |
UpperColor |
Upper rail colour. Upper rail colour, default `clrTomato`. | tomato |
LowerColor |
Lower rail colour. Lower rail colour, default `clrDodgerBlue`. | dodger blue |
MidColor |
Midline colour. Midline colour, default `clrSilver`. | silver |
RailWidth |
Rail line width. Rail line thickness, default `2`. | 2 |
Alert settings
| Setting | What it does | Default |
|---|---|---|
EnableAlerts |
Head switch across the four routes, default `true`. | on |
EnablePopup |
MetaTrader dialog on a rail break, default `true`. | on |
EnablePushNotify |
(see inputs panel) | off |
EnableEmail |
(see inputs panel) | off |
EnableSound |
(see inputs panel) | off |
SoundFile |
(see inputs panel) | alert.wav |

Settings that fit your chart
A channel needs a move with structure. EURUSD H1 is the reference chart, where `MaxSearchBars` `600` reaches back about a month. On M5 the channel redraws several times a session. H4 holds one for weeks.
When the Auto Trend Channel Indicator fails
A six-bar pivot confirms six bars late, so the channel always trails.
Only the two most recent swings anchor it, so older structure gets dropped.
A channel drawn through a range describes noise rather than a trend.
Copy the compiled Auto Trend Channel 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.
Download the Auto Trend Channel Indicator for MT4 and MT5
The zip holds the compiled Auto Trend Channel 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
Why does FractalDepth 6 suit a channel?
It rejects the small turns that would tilt the slope at random. Six bars either side keeps only swings big enough to define a move, which is what makes the resulting channel stable.
How does FractalDepth place the lower rail?
Both recent swing lows are measured against the upper rail, and the one sitting further below it wins. That way the channel contains every recent low rather than slicing through one.
What does RayRight true change?
It extends both rails forward past the current bar. Without that extension there would be no level to compare a new close against, so the break alert depends on it being on.
Why does ShowMidline leave the data window empty?
This build declares no plot buffers at all. The midline, both rails and every label are chart objects, which is why nothing reaches the data window and why the drawings survive a chart refresh.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Auto Trend Channel Indicator as one input. Always backtest before trading live.
External references
- The core method is documented in Head fake on Wikipedia.
- Additional market context is at icci (CCI) at the MQL5 Documentation.
