The ats trend indicator trails a line on one side of price and flips it when a close breaks through the opposite band. What sets it apart is the centre: an SMA-smoothed typical price rather than a raw bar median, which damps the whipsaw a rough centre causes. ATS Trend Up and ATS Trend Down carry the two states.
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: ATS Trend Up, ATS Trend Down, ATS Buy, ATS Sell |
| Alerts | popup, push notification, email, sound |
| Inputs | 10 |
What the Ats Trend Indicator draws on the chart
ATS Trend Up (blue) is the line while the state reads rising.
ATS Trend Down (orange red) takes over once it flips the other way.
ATS Buy (lime, code 233) and ATS Sell (red, code 234) mark each flip bar.
A text object writes BUY or SELL beside the arrow at every turn.
- ATS Trend Up: line, dodger blue, width 2
- ATS Trend Down: line, orange red, width 2
- ATS Buy: arrow, lime, width 3, arrow code 233
- ATS Sell: arrow, red, width 3, arrow code 234

How the Ats Trend Indicator calculates its values
A smoothed centre
The centre starts as the typical price of each bar, then passes through a simple average over InpCentreSmooth bars. A raw median jumps around with every candle, and smoothing it first calms the bands built on top.
That is the difference between this and the usual band construction, which centres on the bar median untouched.
Bands that only tighten
ATR over InpAtrPeriod bars multiplied by InpMult gives the raw distance either side of the centre. Those raw values move freely and never reach a plot.
Each band then gets compared against its own previous value and the previous close, and may only move in the direction that tightens it. That ratchet is what converts a band into a trailing line.
Flipping on a closed bar
The state persists until a close finishes through the opposite band. A rising state flips only when price closes below the lower line, and the mirror applies going the other way.
Resolving on closed bars is what keeps a printed flip from moving afterwards. The bar that produced it is already finished when the check runs.
How to read the signals
Line colour is the state. Blue means rising, orange red means falling.
Distance between price and the line is the room InpMult currently allows, not a target.
A wide gap usually means ATR expanded, since band distance scales with it.
The text label repeats what the arrow says, which helps on a chart carrying several tools at once.
Alert channels in this build: popup, push notification, email and sound, one message per closed bar.
Alerts cover popup, push, email and sound on each flip. A bar time check keeps it to one alert per closed bar.
Every Ats Trend Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
InpAtrPeriod |
ATR period. InpAtrPeriod is the volatility window behind band distance. It defaults to 14. | 14 |
InpMult |
ATR band multiplier. InpMult sets how many ATRs the band sits from the centre, 3.5 by default. Lowering it towards 2.5 tightens the line and produces more flips. | 3.5 |
InpCentreSmooth |
Centre SMA smoothing (bars). InpCentreSmooth averages the typical price before the bands are built, 5 bars by default. Raising it calms the line further. | 5 |
Display settings
| Setting | What it does | Default |
|---|---|---|
InpArrowOffset |
Flip-arrow offset (points). InpArrowOffset is the cosmetic gap between a flip marker and its candle, 35 points by default. | 35 |
Alert settings
| Setting | What it does | Default |
|---|---|---|
EnableAlerts |
(see inputs panel) | on |
EnablePopup |
(see inputs panel) | 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
The screenshot uses EURUSD H1. A 3.5 multiplier is wide, which suits instruments that trend for a stretch before resting. H1 and H4 give the ratchet time to work. On M5 the flips arrive often enough that the trailing behaviour never develops, and lowering InpMult there makes it worse rather than better.
When the Ats Trend Indicator fails
A trailing line reacts, it never predicts. The flip lands after price has already gone through the band.
Sideways conditions flip it repeatedly, and each flip costs the width of the band before the next one arrives.
Smoothing the centre reduces whipsaw and adds delay, so a genuine turn registers later than it would on a raw median.
Band distance follows ATR, which expands after a fast move rather than before one.
Copy the compiled Ats 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 Ats Trend Indicator for MT4 and MT5
The zip holds the compiled Ats 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.
FAQ
Why smooth the centre with InpCentreSmooth instead of using the bar median?
A raw median moves with every candle, and bands built on it inherit that jitter, which produces flips on noise. Averaging the typical price over five bars first gives the bands a steadier reference. The cost is a slightly later turn on a genuine reversal.
What makes InpMult 3.5 a wide setting?
The band sits three and a half ATR readings from the centre, so price needs a large move to close beyond it. That tolerates deep pullbacks without flipping. Lowering it towards 2.5 catches turns sooner and produces considerably more false flips.
Can a printed ATS Buy arrow move later?
No. The check resolves on closed bars, so the close that triggered a flip is already fixed when the state changes. What appears on your chart at the close of that bar stays where it is.
What does the ratchet do with the InpMult band distance?
Each band gets compared against its own previous value and the previous close, then allowed to move only in the tightening direction. While the state reads rising, the lower line can climb with price but never fall back. That is what turns a band into a trailing line.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Ats Trend Indicator as one input. Always backtest before trading live.
External references
- Learn more about the underlying method in Global Financial Centres Index on Wikipedia.
- For wider market background, see ibwmfi (BWMFI) at the MQL5 Documentation.
