Opens in a new tab
AO Divergence Indicator MT4

AO Divergence Indicator MT4

The Awesome Oscillator is one of the most-copied divergence tools in retail trading, but most versions only give you one flavor of it. The AO Divergence indicator gives you three: the classic AO histogram, a normalized 0-1 version of it, or an RSI-based reading in the same slot, with automatic buy/sell divergence arrows built on…

Download the AO Divergence Indicator MT4

The Awesome Oscillator is one of the most-copied divergence tools in retail trading, but most versions only give you one flavor of it. The AO Divergence indicator gives you three: the classic AO histogram, a normalized 0-1 version of it, or an RSI-based reading in the same slot, with automatic buy/sell divergence arrows built on top of whichever one you choose. Download it below and add it to your chart’s lower window.

What Is the AO Divergence Indicator?

At its core, this indicator calculates the difference between a fast and slow simple moving average of the median price (fastma and slowma, defaulting to 5 and 34 — the standard Awesome Oscillator setup), and plots it as a two-color histogram: green when the current bar’s value is rising versus the prior bar, red when it’s falling. A mode input lets you swap the underlying calculation entirely — mode 0 is the standard AO, mode 1 normalizes that same AO reading to a 0-1 range using a 200-bar rolling high/low, and mode 2 replaces AO altogether with RSI(slowma) minus 50, giving you a bounded oscillator in the same histogram format.

On top of the histogram, the indicator scans for divergence: it locates a peak or trough in the oscillator, then looks back divergencebars candles for the price extreme tied to it, and compares that against the next matching peak/trough further back in history. When the price extreme and the oscillator extreme disagree — a textbook divergence — it marks the bar with an up arrow (buy) or down arrow (sell) using MetaTrader’s built-in wingdings arrow codes 233 and 234.

Key Features

  • Three oscillator modes in one indicator — standard AO, a 0-1 normalized AO, or an RSI-based reading, switched with the mode input.
  • Two-color histogram — the chosen oscillator is plotted as a rising (up-color) or falling (down-color) histogram bar by bar, making momentum direction obvious at a glance.
  • Automatic divergence arrows — buy and sell arrows are plotted directly on confirmed divergence bars, no manual trend-line drawing required.
  • Adjustable divergence lookback — the divergencebars input controls how far back the indicator searches for the matching price extreme when comparing peaks and troughs.
  • Signal filter — the isshowsignaltype1 input restricts arrows to divergence-confirmed peaks only (the default), rather than marking every raw oscillator peak regardless of whether a divergence is actually present.

How to Use It

Install it in the usual way — copy the compiled file into MQL4/Indicators, restart or refresh MetaTrader, and drag it onto a chart from the Navigator. It opens in its own subwindow below price.

Choose your mode first: leave mode at 0 for the classic Awesome Oscillator, switch to 1 if you want a bounded, normalized version that’s easier to compare across symbols, or use 2 for an RSI-based reading. If you’re using mode 0 or 1, fastma and slowma control the two moving averages behind the calculation — the 5/34 defaults are the standard AO setup and rarely need changing.

Read the histogram color for basic momentum bias — green bars mean momentum is building in the current direction, red bars mean it’s fading. The real signal, though, is the arrow: an up arrow below a bar means the oscillator found a bullish divergence against price within the divergencebars lookback window, and a down arrow above a bar means the opposite. Because this version of the indicator has no built-in Alert(), email, or push notification calls, you’ll need to watch the chart directly or pair it with a separate alert utility if you want to be notified the moment an arrow appears.

Best Timeframes / Best Use Cases

Divergence tools built on the Awesome Oscillator are typically used as a secondary confirmation layer rather than a standalone entry trigger, and this indicator works the same way on any timeframe since every input — moving average periods, lookback, and mode — is adjustable. It’s best treated as a filter to combine with your existing support/resistance or trend analysis rather than a signal to trade in isolation.

Final Thoughts

Getting three oscillator variants and an automated divergence-arrow engine out of one lightweight, free indicator is a solid deal. The code confirms it only finalizes signals on closed bars, so once an arrow appears it stays put — what you see historically is what actually happened, not a signal that can quietly disappear later.

Download the AO Divergence Indicator MT4
  • fastma (default 5) — Period of the fast simple moving average of median price used in the AO calculation (modes 0 and 1).
  • slowma (default 34) — Period of the slow simple moving average of median price in modes 0/1, or the RSI period used in mode 2.
  • mode (default 0) — Selects the oscillator engine: 0 = standard Awesome Oscillator, 1 = AO normalized to a 0-1 range, 2 = RSI(slowma) minus 50.
  • divergencebars (default 4) — How many bars back the indicator searches for the matching price extreme when checking an oscillator peak or trough for divergence.
  • isshowsignaltype1 (default 1) — When set to 1, only plots arrows on peaks where an actual divergence was confirmed; set to 0 to mark every detected oscillator peak/trough regardless.

FAQs About the MT4 AO Divergence Indicator MT4

One Quick Step

Enter your name and email and check your inbox for the download link.