Loading…

SuperTrend

SuperTrend builds two candidate bands from the midpoint of each bar plus or minus a multiple of ATR, then ratchets them one-way: the upper band can only move down (or hold) while price stays under it, and the lower band can only move up (or hold) while price stays above it. That one-way constraint is what stops the line snapping back toward price on every quiet bar instead of trailing it properly, and it is the part of the formula that is easy to get subtly wrong. The active band flips the moment price closes through it - from lower band (support, uptrend) to upper band (resistance, downtrend) or back - and that single active line is what is plotted. Because neither platform can recolour a single line plot mid-series, the uptrend and downtrend segments are drawn as two separate coloured buffers with gaps everywhere the other trend is active, which is why the indicator ships as two lines rather than one that changes colour. ATR itself comes from the built-in iATR() call rather than a hand-rolled true-range average, so the band width matches whatever plain ATR is already on the chart. Notes and limitations - Like every ATR-band trend tool, SuperTrend trails price well in a trending market and whipsaws in a ranging one - there is no multiplier setting that removes that trade-off, only shifts where it bites. - The line only ever confirms a flip on a closed bar; it does not predict the next one. - Early bars near the start of loaded history can show a flat or inaccurate band until ATR itself has enough bars to warm up - normal for any ATR-based tool and not a sign of a fault.

Indicator · MT4 · v1.0 · Free

About SuperTrend

SuperTrend is an indicator for MetaTrader 4 based on ATR. It has 2 settings, such as Atr period and Multiplier. MQL source code included.

Files in the download: SuperTrend.ex4, SuperTrend.mq4, SuperTrend.txt.

Settings

SettingDefaultWhat it does
Atr period10ATR period used for the band width
Multiplier3.0ATR multiplier - wider bands flip less often

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Indicators.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the indicator from the Navigator onto a chart and adjust the settings.

Download the PDF guide

Tags: ATR · Trend · Trailing Stop & Break-even · MT4 Indicator · MQL4 Source Code

MetaTrader 4 & 5 indicators · PolyMaria