The best adaptive macd indicator swaps the two fixed averages behind a normal MACD for adaptive ones. Each average speeds up when price travels in a straight line and slows down when it chops. Adaptive MACD plots the gap between them, and Signal smooths that gap.
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 | Separate window (levels 0) |
| Plots | 2: Adaptive MACD, Signal |
| Alerts | popup, push notification, email, sound |
| Inputs | 11 |
What renders
Adaptive MACD (blue line) is the fast adaptive average minus the slow one.
Signal (orange line) averages that difference over the Signal setting.
A zero line crosses the pane where the two adaptive averages meet.
- Adaptive MACD: line, dodger blue, width 2
- Signal: line, orange, width 1

Step by step through the logic
The efficiency ratio
Each average asks one question first. How much of the recent movement actually went somewhere? The code measures how far price travelled in a straight line over the period. Then it divides that by the sum of the single bar moves.
A trending stretch returns a ratio near one. The two figures come out close. A choppy stretch returns a ratio near zero, because price travelled far and arrived nowhere.
Turning the ratio into a speed
FastEmaSc and SlowEmaSc define two smoothing constants, 2 and 30 by default. On every bar the ratio slides the average between those two speeds.
A ratio near one puts the average on the fast constant. A ratio near zero parks it on the slow one. That slide is the whole adaptive mechanism.
Making the plotted line
FastAmaPeriod and SlowAmaPeriod set the two efficiency windows at 10 and 21. Both run the same maths. They differ only in how much history feeds the ratio.
Subtracting the slow average from the fast one gives the plotted value. Averaging the last few of those values over the Signal length gives the second line.
What matters on screen
Adaptive MACD crossing above Signal reads like a normal MACD cross. It just gets there another way.
Both lines flatten in choppy conditions on purpose. The averages behind them have slowed down.
A cross while the lines move quickly carries a higher efficiency ratio. One during a flat stretch carries a lower one.
Distance from zero shows how far apart the two adaptive averages have drifted.
Alert channels in this build: popup, push notification, email and sound.
Alerts cover popup, push, email and sound. This build carries no once-per-bar guard, so a condition can alert more than once while the same bar is still forming.
Every Best Adaptive MACD Indicator input
Core settings
| Setting | What it does | Default |
|---|---|---|
FastAmaPeriod |
FastAmaPeriod is the efficiency window for the faster average. It defaults to 10. | 10 |
SlowAmaPeriod |
SlowAmaPeriod is the same window for the slower average, 21 by default. | 21 |
Signal |
Signal is how many values get averaged into the second line. It defaults to 9. | 9 |
FastEmaSc |
fast SC = 2 / (FastEmaSc + 1). FastEmaSc sets the quick smoothing constant through two divided by FastEmaSc plus one. It defaults to 2, about as fast as an average gets. | 2 |
SlowEmaSc |
slow SC = 2 / (SlowEmaSc + 1). SlowEmaSc does the same at the slow end and defaults to 30, giving a heavily smoothed floor speed. | 30 |
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 |

Timeframes worth trying
The screenshot uses EURUSD H1. Adapting by efficiency pays off most on charts that swap between trending and ranging. That covers most majors on H1 and H4. On very fast timeframes the ratio sits near zero much of the time. Both averages then park on their slow constant, and the lines barely separate.
When to distrust it
Adapting removes some lag and never all of it. Both averages still need bars before they can answer a turn.
An efficiency ratio cannot tell a clean trend from a clean gap. One large candle lifts the ratio and speeds both averages up for the wrong reason.
Both averages start from a raw close at the oldest bar, not an average. So the earliest values on a fresh chart come out rough.
There is no histogram in this build. Judging how fast the two lines close in takes more attention than watching bars shrink.
Copy the compiled Best Adaptive MACD 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 Best Adaptive MACD Indicator: National best bid and offer on Wikipedia, MACD Moving Average Convergence Divergence Oscillator at StockCharts ChartSchool.
Download the Best Adaptive MACD Indicator for MT4 and MT5
The zip holds the compiled Best Adaptive MACD 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 the efficiency ratio do to FastAmaPeriod?
FastAmaPeriod sets how far back the ratio looks, 10 bars by default. The ratio itself then decides that average speed on every bar. A longer window makes the ratio steadier. The average then changes pace less abruptly, which suits a chart that gaps around.
How is this different from a MACD with 12 and 26?
A standard MACD uses two fixed speed averages. Here both change speed bar by bar, between the constants set by FastEmaSc and SlowEmaSc. Through a strong trend they run fast and the lines separate quickly. In chop they slow down and the reading flattens out.
Why do alerts sometimes repeat on the same bar?
This build has no once-per-bar latch. The check runs as values update, so a condition flickering while the current candle still forms can fire more than once. Waiting for the bar to close before acting on it is the practical answer.
Should I raise SlowEmaSc above the default of 30?
Raising it makes the slow end slower still. An average sitting on a low efficiency ratio then goes almost flat. That calms the reading in ranges. It also costs you a later response when a trend finally starts. Lowering it does the reverse.
Are results guaranteed?
No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Best Adaptive MACD Indicator as one input. Always backtest before trading live.
Category: this is part of our Oscillators collection. Also, browse more Oscillators for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.
External references
- The core method is documented in National best bid and offer on Wikipedia.
- Additional market context is at MACD Moving Average Convergence Divergence Oscillator at StockCharts ChartSchool.
