The non repaint oscillator indicator runs the same smoothing twice over two different price series. One follows the close and one follows the bar midpoint. Both use `Period` bars. Where the two lines separate, the closes have been finishing away from the middle of their bars.
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 | 2: Non Close, Non Mid |
| Alerts | popup, push notification, email, sound |
| Inputs | 7 |
What the Non repaint oscillator Indicator draws on the chart
Non Close is the dodger blue line, smoothed from the closing price.
Non Mid is the slate blue line, smoothed from the bar midpoint.
Both sit directly over price rather than in a pane.
Nothing else appears on the chart.
- Non Close: plot, dodger blue
- Non Mid: plot, slate blue

How the Non repaint oscillator Indicator calculates its values
One constant, two series
k takes 2 over `Period` `34` plus one. CloseBuf blends each new close with its own previous value. MidBuf does the same with high plus low over two. Identical smoothing, different inputs.
Seeding both lines
At the oldest bar CloseBuf takes the close directly and MidBuf takes the midpoint. Starting from a real price rather than zero is what stops either line spiking across the left edge of the chart.
Why the gap matters
A close finishing near the middle of its bar leaves the two lines together. A run of closes near the highs pulls the blue line above the slate one. The separation is a quiet read on where bars have been finishing.
How to read the signals
Two lines together means closes have been landing mid-range.
Blue above slate means closes have been finishing in the upper part of bars.
The gap is usually small, so watch the relationship rather than the distance.
Both lines lag price at `Period` `34`, which is deliberate.
Alert channels in this build: popup, push notification, email and sound, one message per closed bar.
`EnableAlerts` arrives on and `EnablePopup` handles delivery. `EnablePushNotify`, `EnableEmail` and `EnableSound` all begin false. `SoundFile` picks the clip. Tests read completed bars, and the guard allows one message per bar.
Every Non repaint oscillator Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
Period |
Smoothing length for both lines, default `34`. | 34 |
Alert settings
| Setting | What it does | Default |
|---|---|---|
EnableAlerts |
Master switch for the band cross alerts, default `true`. | on |
EnablePopup |
Terminal dialog on a band cross, default `true`. | on |
EnablePushNotify |
Phone push on a band cross, default `false`. | off |
EnableEmail |
Mail delivery on a band cross, default `false`. | off |
EnableSound |
Sound playback on a band cross, default `false`. | off |
SoundFile |
Wav clip for the band alert, default `alert.wav`. | alert.wav |

Settings that fit your chart
Two slow lines over price suit charts where you want context rather than triggers. EURUSD H1 is the reference chart, where `Period` at `34` covers a day and a half. On M5 both lines still lag noticeably. On H4 they describe a fortnight of trade.
When the Non repaint oscillator Indicator fails
The gap between the two lines is often too small to read without zooming in.
Both lines share one setting, so you cannot slow one and speed the other.
Neither line marks anything. Every judgement about them is yours.
Copy the compiled Non repaint oscillator 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 Non repaint oscillator Indicator: Specialized investment fund on Wikipedia, trading advisories at the CFTC.
Download the Non repaint oscillator Indicator for MT4 and MT5
The zip holds the compiled Non repaint oscillator 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 midpoint as well as the close?
Because comparing them says something neither says alone. The close records where a bar finished and the midpoint records its centre. When Non Close pulls away from Non Mid, closes have been landing at one end of their bars.
What does Period at 34 cover?
Thirty-four bars for both lines. On EURUSD H1 that is a day and a half. It is a slow setting by design, since the point is the relationship between two lines rather than a quick reaction to price.
Why does the Non Mid line sit so close to Non Close?
Because the two inputs rarely differ by much. A bar midpoint and a bar close are usually within a few pips of each other. The gap only opens during a run of one-sided closes, which is exactly when it matters.
Can Period differ between the two lines?
Not from the inputs. `Period` `34` drives both, which keeps the comparison fair. Two different lengths would make the gap a mix of smoothing difference and price behaviour, and the reading would lose its meaning.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Non repaint oscillator Indicator as one input. Always backtest before trading live.
Category: this is part of our Oscillators collection. Browse more Oscillators for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.
External references
- For background on this concept, see Specialized investment fund on Wikipedia.
- For broader market context, see trading advisories at the CFTC.
