The non repaint tma bands indicator runs a simple moving average twice over the same series. That double pass is what makes a triangular moving average. The bands then sit at a multiple of how far price has strayed from that curve, rather than at a multiple of raw price volatility.
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 | 5: TMA, Upper Band, Lower Band, Buy Signal, Sell Signal |
| Alerts | popup, push notification, email, sound |
| Inputs | 10 |
What the Non repaint tma bands Indicator draws on the chart
TMA is the dodger blue centre line, smoothed twice at `TmaPeriod` bars per pass.
Upper Band and Lower Band are the orange red lines either side of it.
Buy Signal and Sell Signal place lime and red arrows at band crossings.
Each arrow keeps `ArrowOffsetPts` points of clearance, which defaults to `12`.
- TMA: line, dodger blue, width 2
- Upper Band: line, orange red, width 1
- Lower Band: line, orange red, width 1
- Buy Signal: arrow, lime, width 3, arrow code 233
- Sell Signal: arrow, red, width 3, arrow code 234

How the Non repaint tma bands Indicator calculates its values
Smoothing the average twice
Sma1 holds a plain simple moving average over `TmaPeriod` `20`. TmaBuf then averages Sma1 over the same twenty bars. Running the average twice weights the middle of the window most heavily, which is where the triangular name comes from. The result is smoother than a single pass and lags a little more.
Sizing the bands from residuals
Dev takes close minus TmaBuf on each bar. The code then measures the standard deviation of Dev over `StdevPeriod` `20`. UpBuf takes TmaBuf plus `BandMultiplier` times that number and DnBuf subtracts it. So the bands describe how far price usually sits from this particular curve.
Confirming a crossing on a closed bar
A buy needs the previous close below DnBuf and the current close at or above it. A sell mirrors that against UpBuf. The loop skips bar 0 entirely, so a mark appears only once the bar has closed. That behaviour is what the non-repaint label refers to here.
How to read the signals
Price outside a band has moved further from the curve than it usually does.
Narrow bands mean price has been tracking the smoothed average closely.
The centre line turns late by design, since it is an average of an average.
An arrow marks a crossing back inside the band, not a breakout.
Alert channels in this build: popup, push notification, email and sound, one message per closed bar.
`EnableAlerts` ships on with `EnablePopup`, `EnablePushNotify` and `EnableSound` true and `EnableEmail` false. `AlertSoundFile` names the clip. The check reads bar 1 and includes its close, so one message follows each completed bar.
Every Non repaint tma bands Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
TmaPeriod |
TMA period (each SMA pass). Bars in each smoothing pass, default `20`. The effective window is wider than that, because the average runs twice. | 20 |
BandMultiplier |
Band width multiplier. Band width in residual deviations, default `2.0`. Raise it to 2.5 for rarer crossings. | 2.0 |
StdevPeriod |
Stdev lookback for bands. Bars used for the residual deviation, default `20`. | 20 |
Display settings
| Setting | What it does | Default |
|---|---|---|
ArrowOffsetPts |
Arrow vertical offset (points). Arrow clearance from the bar in points, default `12`. | 12 |
Alert settings
| Setting | What it does | Default |
|---|---|---|
EnableAlerts |
Master alert switch. Master alert switch, default `true`. | on |
EnablePopup |
Popup alert. Terminal popup, default `true`. | on |
EnablePushNotify |
Mobile push alert. Mobile push, default `true`. | on |
EnableEmail |
Email alert. Mail delivery, default `false`. | off |
EnableSound |
Sound alert. Sound playback, default `true`. | on |
AlertSoundFile |
Sound file. Clip played when sound is on, default `alert.wav`. | alert.wav |

Settings that fit your chart
Band crossings suit ranges better than trends. EURUSD H1 is the reference chart, where `TmaPeriod` at `20` covers most of a trading day across the two passes. Down on M5 the bands react slowly compared with price and crossings cluster. Up on H4 the curve describes a week and the signals turn scarce.
When the Non repaint tma bands Indicator fails
A double-smoothed average lags twice over, so the centre line always sits behind a turn.
In a strong trend price can ride the outer band for many bars and cross it repeatedly.
Residual deviation assumes the misses stay evenly spread. Around news they do not.
Copy the compiled Non repaint tma bands 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 Non repaint tma bands Indicator for MT4 and MT5
The zip holds the compiled Non repaint tma bands 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
What does TmaPeriod at 20 actually smooth?
Twenty bars, twice over. The code builds a simple average across twenty closes, then averages that series over twenty bars again. The effective window is therefore wider than twenty bars, and the curve carries roughly double the lag of a single pass.
Why does BandMultiplier use residuals?
Because the residuals measure the right thing. Dev holds close minus the smoothed curve, and its deviation describes how far price usually strays. Multiplying that by `BandMultiplier` at `2.0` puts the bands where a crossing is genuinely unusual for this average.
Does StdevPeriod have to match TmaPeriod?
No. Both default to `20`, which keeps the two measurements on the same footing, but they remain separate settings. Raise `StdevPeriod` alone for steadier bands around the same curve. Lower it and the bands react faster than the line they surround.
What puts a Buy Signal arrow on the chart?
On a closed bar where the previous close sat below the lower band and the current close reaches or clears it. The mark lands at low minus `ArrowOffsetPts` points. The loop skips the forming bar, so nothing appears and then vanishes part way through.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Non repaint tma bands Indicator as one input. Always backtest before trading live.
Category: this is part of our Signal and Forecast collection. Browse more Signal and Forecast for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.
External references
- Learn more about the underlying method in Systemic risk on Wikipedia.
- For wider market background, see Fibonacciextensions at Investopedia.
