A trend path is a line that follows price at a distance and only turns when price crosses it. This trend path non repaint indicator builds that line from a 50-bar exponential average of the median price, offset by two and a half average ranges, and marks the closed bar where the path flips.
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: Up Path, Down Path, Buy Flip, Sell Flip |
| Alerts | popup, push notification, email, sound |
| Inputs | 11 |
What draws where
One two-colour path plus two marks.
`Up Path` traces lime green below price.
`Down Path` traces orange red above price.
`Buy Flip` prints lime green with arrow 233.
`Sell Flip` prints orange red with arrow 234.
A status block shows the trend and path price.
- Up Path: line, lime green, width 2
- Down Path: line, orange red, width 2
- Buy Flip: arrow, lime green, width 2, arrow code 233
- Sell Flip: arrow, orange red, width 2, arrow code 234

How the calculation works
The centre
`EmaPeriod` `50` smooths the median of each bar’s high and low. The path is built around that line.
The distance
`AtrMult` `2.5` times an `AtrPeriod` `14` range sets how far the path trails. In an up-trend the path can only rise.
The flip
A close through the path turns the trend. The path jumps to the other side, and a flip mark prints on that closed bar.
Reading the plots
Green below price means up-trend.
Orange red above price means down-trend.
The path steps but never retreats mid-trend.
A mark means the side changed on a close.
`ShowFlipArrows` `true` draws those marks.
Warm-up needs about fifty-two bars.
Alert channels in this build: popup, push notification, email and sound, one message per closed bar.
Each confirmed flip sends one message naming the new side. `EnableAlerts` decides whether it goes out; the popup ships on, and the other three routes ship off.
Every Trend Path Non Repaint Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
EmaPeriod |
EMA length for the trend-path basis. Length of the centre line, `50`. | 50 |
AtrPeriod |
ATR length for the channel width. Range window, `14`. | 14 |
AtrMult |
ATR multiplier (path distance). Path distance in ranges, `2.5`. | 2.5 |
Display settings
| Setting | What it does | Default |
|---|---|---|
ArrowGapPts |
Arrow gap from the bar (in points). Mark gap in points, `12`. | 12 |
ShowFlipArrows |
Draw arrows on each confirmed flip. Mark each flip, `true`. | on |
Alert settings
| Setting | What it does | Default |
|---|---|---|
EnableAlerts |
Switch for flip messages, `true`. | on |
EnablePopup |
Popup, `true`. | on |
EnablePushNotify |
Phone route, `false`. | off |
EnableEmail |
Email route, `false`. | off |
EnableSound |
Speaker, `false`. | off |
SoundFile |
(see inputs panel) | alert.wav |

Choosing where it lives
A wide trailing path suits charts with clean swings. EURUSD H1 is the reference chart, with a flip every few days. On M15 lower `AtrMult` for quicker flips. On D1 each flip marks a change in the larger trend.
Known weak points
A trailing path always gives back part of a move.
Choppy ranges produce back-to-back flips.
A wide distance reacts late at turns.
Only a popup reports by default.
Copy the compiled Trend Path Non Repaint 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.
Background reading on the method behind the Trend Path Non Repaint Indicator: Trailing Stop at Investopedia, Average true range on Wikipedia.
Download the Trend Path Non Repaint Indicator for MT4 and MT5
The zip holds the compiled Trend Path Non Repaint 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 Up Path never move down mid-trend?
Each bar it takes the higher of its old value and the new one. That ratchet keeps the stop-like line locked in place until price finally closes through it.
What does AtrMult 2.5 trade off?
Room against speed. A wider path survives normal pullbacks but flips late; lowering it flips sooner and more often, including on plain noise in quiet sessions.
Why is EmaPeriod 50 applied to the median price?
The median of each bar’s high and low ignores where the bar closed. It gives a steadier centre line than closes do, especially on bars with long wicks.
Can a Buy Flip disappear after it prints?
No. The flip is judged on a closed bar, and the path for that bar is already fixed. Nothing that happens on later bars can change it or remove the mark.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Trend Path Non Repaint 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
- Learn more about the underlying method in Foreign exchange date conventions on Wikipedia.
- For wider market background, see Stockcharts High Low Index at StockCharts ChartSchool.
