SwingArm ATR Trend Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

A SwingArm is a trailing stop drawn on the chart. The swingarm ATR trend indicator keeps a line three average ranges below the close in an up-trend, lets it only rise, and flips it above price when a close breaks through. Each flip gets a mark.

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 4: SwingArm Up, SwingArm Down, SwingArm Buy, SwingArm Sell
Alerts popup, push notification, email, sound
Inputs 9

The plots and where they sit

One two-colour line and two marks.

`SwingArm Up` traces lime green under price.

`SwingArm Down` traces orange red above price.

`SwingArm Buy` prints lime with arrow 233.

`SwingArm Sell` prints red with arrow 234.

A status line shows the trend and arm.

  • SwingArm Up: line, lime green, width 2
  • SwingArm Down: line, orange red, width 2
  • SwingArm Buy: arrow, lime, width 2, arrow code 233
  • SwingArm Sell: arrow, red, width 2, arrow code 234
swingarm atr trend indicator: SwingArm trailing line with flips, EURUSD H1.
SwingArm trailing line with flips, EURUSD H1.

How the Swingarm Atr Trend Indicator does its maths

Distance

`AtrMult` `3.0` times an `AtrPeriod` `14` Wilder range sets how far the arm trails the close.

Ratchet

In an up-trend the arm takes the higher of its old level and the new one, so it never falls. Down-trends mirror this.

Flip

A close through the arm flips the trend. The arm jumps to the other side, and the flip bar gets a mark.

Reading the output

Green under price means up-trend.

Orange red over price means down-trend.

Flat stretches mean the arm is holding.

Marks show the first bar of a new trend.

`ArrowGapAtr` `0.5` spaces the marks.

Warm-up needs about fifteen bars.

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

Each flip of the arm reports as a buy or sell. `EnableAlerts` covers it, and at first only the popup carries the message.

Every Swingarm Atr Trend Indicator input

Core settings

Setting What it does Default
AtrPeriod ATR lookback (Wilder). Range window, `14`. 14
AtrMult ATR multiple for the swing arm. Arm distance in ranges, `3.0`. 3.0

Display settings

Setting What it does Default
ArrowGapAtr arrow offset in ATR units. Mark gap in ranges, `0.5`. 0.5

Alert settings

Setting What it does Default
EnableAlerts Master alert switch, `true`. on
EnablePopup Popup, `true`. on
EnablePushNotify Mobile route, `false`. off
EnableEmail Email route, `false`. off
EnableSound Speaker, `false`. off
SoundFile Speaker clip, `”alert.wav”`. alert.wav
swingarm atr trend indicator: Inputs panel, range settings above the alert routes.
Inputs panel, range settings above the alert routes.

Picking a chart for it

A three-range arm suits trending charts. EURUSD H1 is the reference chart, with a flip every few days. On M15 lower `AtrMult` for tighter trailing. On D1 the arm works as a swing stop.

Limits worth knowing

Trailing gives back part of every move.

Choppy markets cause back-to-back flips.

A wide arm flips late at tops and bottoms.

Just the popup is on at the start.

Copy the compiled Swingarm Atr Trend 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 Swingarm Atr Trend Indicator for MT4 and MT5

The zip holds the compiled Swingarm Atr Trend 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

Why does SwingArm Up never move down?

Each bar it keeps the higher of its old level and the close minus three ranges. That ratchet locks in progress until a close finally breaks through.

Is AtrMult 3.0 too wide for a SwingArm on M15?

Often, yes. Three ranges survive most pullbacks on hourly charts but flip late on fast ones. On M15, two ranges trail closer and flip sooner, at the cost of more flips on noise.

When does a SwingArm Buy print?

On the closed bar where the close moves above the down-trend arm. The arm then jumps below price and turns green from that bar on.

Can the SwingArm Down line act as a stop?

Many traders use it that way, since it trails at a fixed distance in ranges. Treat it as a reference level, not a promise that price will respect it on the next bar.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Swingarm Atr Trend 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