Support Resistance Trend Line Indicator: Slope Colour

Written by Dominic Walsh · Published · Last updated

The support resistance trend line indicator puts two ideas on one chart. A smoothed line carries direction and changes colour when its slope flips. Separately, it draws the nearest fractal high and low as flat levels.

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 2: SR Trend Up, SR Trend Down
Alerts popup, push notification, email, sound
Inputs 14

What the Support resistance trend line Indicator draws on the chart

`SR Trend Up` carries the line in lime green while its slope rises.

`SR Trend Down` carries it in orange red while the slope falls.

`ShowLevels` adds horizontal lines at the nearest fractal high and low.

Those levels use `ResColor` `clrTomato` and `SupColor` `clrDodgerBlue`.

  • SR Trend Up: line, lime green, width 2
  • SR Trend Down: line, orange red, width 2
Support resistance trend line indicator slope-coloured line and levels on EURUSD H1.
Support resistance trend line indicator slope-coloured line and levels on EURUSD H1.

How the Support resistance trend line Indicator calculates its values

One smoothed line, three methods

`InpPeriod` `50` sets the window. `InpMethod` `SM_EMA` picks the smoothing. The build offers simple, exponential and Hull, so one window can behave three ways.

Slope decides the colour

Comparing the line against its previous value gives the direction. Both buffers also receive the previous bar, which bridges the join so the coloured segments connect rather than break apart.

A flip has to clear a threshold

`InpAtrMult` `0.10` times the reading from `InpAtrPeriod` `14` sets a minimum slope. A colour change below that does not count. Set it to zero and every wobble flips the colour.

How to read the signals

Colour is a statement about the line, never about price position.

The flat levels come from `SwingBars` `12` fractals, not from the line.

A long single-colour stretch means the slope held one way throughout.

The two features are independent, so they can disagree.

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

`EnableAlerts` sits above four routes and ships true with `EnablePopup`. `EnablePushNotify` covers the phone, `EnableEmail` covers mail and `EnableSound` plays `SoundFile`. Those three begin false. Nothing sends until a bar closes.

Every Support resistance trend line Indicator input

Core settings

Setting What it does Default
InpPeriod Trend line period (lookback). Bars in the smoothed line, default `50`. 50
InpMethod Smoothing method (SMA/EMA/HMA). Smoothing type, simple, exponential or Hull, default `SM_EMA`. SM_EMA
SwingBars Fractal swing strength (bars each side). Bars either side that confirm a fractal level, default `12`. 12
InpAtrPeriod ATR period (flip filter). Bars in the range reading behind the flip filter, default `14`. 14
InpAtrMult Min flip slope as x ATR (0 = off). Minimum slope for a flip, in range units, default `0.10`. 0.10

Display settings

Setting What it does Default
ShowLevels Draw nearest S/R fractal levels. Draw the nearest fractal support and resistance, default `true`. on
ResColor Resistance line colour. Resistance level colour, default `clrTomato`. tomato
SupColor Support line colour. Support level colour, default `clrDodgerBlue`. dodger blue

Alert settings

Setting What it does Default
EnableAlerts Switch above the four routes, default `true`. on
EnablePopup Notice inside the terminal, default `true`. on
EnablePushNotify (see inputs panel) off
EnableEmail (see inputs panel) off
EnableSound (see inputs panel) off
SoundFile (see inputs panel) alert.wav
Support resistance trend line indicator inputs panel with InpPeriod, InpMethod and SwingBars.
Support resistance trend line indicator inputs panel with InpPeriod, InpMethod and SwingBars.

Settings that fit your chart

A fifty-bar line plus twelve-bar fractals needs history. EURUSD H1 is the reference chart, where the line covers two days and levels update every few. On M5 the colour flips often. H4 gives a very steady picture.

When the Support resistance trend line Indicator fails

A twelve-bar fractal confirms twelve bars late, so a level is never fresh.

`InpAtrMult` `0.10` is a light filter, so flat markets still produce colour flips.

The line and the levels answer different questions, which can read as a mixed signal.

Copy the compiled Support resistance trend line 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 Support resistance trend line Indicator for MT4 and MT5

The zip holds the compiled Support resistance trend line 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 does InpAtrMult 0.10 filter?

Colour flips driven by a slope too small to matter. The line must turn by at least a tenth of the fourteen-bar range reading. Raising it toward 0.5 removes most cosmetic flips at the cost of confirming later.

How does InpMethod change the line?

It picks between simple, exponential and Hull smoothing over the same fifty bars. Hull turns fastest and simple turns slowest. So one period can give quite different flip timing.

Why does SwingBars 12 make levels late?

A fractal needs twelve bars on each side to confirm, so the twelve newest bars can never contain one. On EURUSD H1 that puts every level at least half a day behind the current candle.

Do the SR Trend Up colours mark entries?

No. The colour reports the slope of a smoothed line and nothing else. There are no arrow buffers in this build, so any entry rule has to come from you or from another tool on the chart.

Are results guaranteed?

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

Category: this is part of our Trend collection. Browse more Trend for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

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