What is the Awesome Oscillator (AO)?
The Awesome Oscillator (AO) is a momentum indicator developed by Bill Williams, the creator of the Alligator Indicator and Fractals. Unlike most oscillators that compare closing prices, the AO compares the recent market momentum (5-period simple moving average of midpoints) with the broader market momentum (34-period simple moving average of midpoints). It is typically plotted as a histogram, with bars colored green (momentum up) or red (momentum down).
The Awesome Oscillator is designed to reflect the underlying driving force of the price, helping traders identify changes in momentum, confirm trends, and spot potential reversal signals based on specific patterns.
Components and Calculation
The calculation of the Awesome Oscillator is based on two Simple Moving Averages (SMAs) of the `midpoint` price (which is `(High + Low) / 2`):
- Short Period SMA: Calculate a 5-period SMA of the `midpoint` price.
- Long Period SMA: Calculate a 34-period SMA of the `midpoint` price.
- AO Formula:
`AO = Short Period SMA of Midpoint - Long Period SMA of Midpoint`
The resulting value oscillates around a zero line. Bars are colored based on their relation to the previous bar: green if current AO > previous AO, red if current AO < previous AO.
Basic Awesome Oscillator Implementation in Pine Script
Pine Script v5 provides a convenient built-in function `ta.ao()` for straightforward implementation.
//@version=5
indicator("My Awesome Oscillator", overlay=false) // overlay=false to plot in a separate pane
// Calculate Awesome Oscillator using the built-in function
// ta.ao uses (high+low)/2 as source and default lengths 5 and 34
aoValue = ta.ao()
// Plot the Awesome Oscillator as a histogram
// Color based on whether current AO is greater than previous AO
plot(aoValue, title="AO", style=plot.style_columns, color=aoValue >= aoValue[1] ? color.green : color.red)
// Plot the Zero Line
hline(0, "Zero Line", color.gray, linestyle=hline.style_solid)
Practical Awesome Oscillator Trading Strategies
1. Zero Line Crossover
The zero line is a crucial level for the Awesome Oscillator, indicating a shift in momentum from bearish to bullish or vice versa. It's often used as a primary signal for trend initiation.
- Buy Signal: AO crosses above the zero line. This indicates a shift from bearish to bullish momentum.
- Sell Signal: AO crosses below the zero line. This indicates a shift from bullish to bearish momentum.
//@version=5
strategy("AO Zero Line Crossover Strategy", overlay=true)
// Calculate Awesome Oscillator
aoValue = ta.ao()
// Define conditions for entries
longSignal = ta.crossover(aoValue, 0)
shortSignal = ta.crossunder(aoValue, 0)
// Strategy entries/exits
if (longSignal)
strategy.entry("Long", strategy.long)
if (shortSignal)
strategy.entry("Short", strategy.short)
// Plot AO in a separate pane for visualization
// plot(aoValue, title="AO", style=plot.style_columns, color=aoValue >= aoValue[1] ? color.green : color.red, display=display.pane_only)
// hline(0, "Zero Line", color.gray, display=display.pane_only)
2. Twin Peaks Strategy
The Twin Peaks strategy uses two peaks (or troughs) on the Awesome Oscillator for reversal signals. This is considered a more reliable signal than simple zero-line crossovers.
- Bullish Twin Peaks: Occurs below the zero line.
- A trough (lowest point) forms below the zero line.
- AO rises but stays below the zero line, then forms a second, higher trough (not necessarily a new lowest point for the entire indicator, just within the relevant swings).
- AO then crosses above the zero line.
- Bearish Twin Peaks: Occurs above the zero line.
- A peak (highest point) forms above the zero line.
- AO falls but stays above the zero line, then forms a second, lower peak.
- AO then crosses below the zero line.
//@version=5
indicator("AO Twin Peaks Scanner", overlay=true)
// Calculate Awesome Oscillator
aoValue = ta.ao()
// Plot AO as a histogram
plot(aoValue, title="AO", style=plot.style_columns, color=aoValue >= aoValue[1] ? color.new(color.green, 0) : color.new(color.red, 0))
hline(0, "Zero Line", color.gray, linestyle=hline.style_solid)
// Implementing robust Twin Peaks logic requires advanced peak/trough detection.
// This is a simplified conceptual example to illustrate the idea, focusing on general AO direction changes around peaks/troughs.
// For a fully robust Twin Peaks strategy, you would need to identify actual swing points in AO.
// Simplified Bullish Twin Peak (AO makes higher low below zero, then crosses zero)
bullishTwinPeakSignal = aoValue[2] < 0 and aoValue[1] < 0 and aoValue > 0 and aoValue[1] > aoValue[2]
// Simplified Bearish Twin Peak (AO makes lower high above zero, then crosses zero)
bearishTwinPeakSignal = aoValue[2] > 0 and aoValue[1] > 0 and aoValue < 0 and aoValue[1] < aoValue[2]
plotshape(bullishTwinPeakSignal, title="Bullish Twin Peak", location=location.belowbar, color=color.new(color.green, 0), style=shape.triangleup, size=size.small)
plotshape(bearishTwinPeakSignal, title="Bearish Twin Peak", location=location.abovebar, color=color.new(color.red, 0), style=shape.triangledown, size=size.small)
alertcondition(bullishTwinPeakSignal, "Bullish AO Twin Peaks", "Potential bullish reversal based on AO Twin Peaks.")
alertcondition(bearishTwinPeakSignal, "Bearish AO Twin Peaks", "Potential bearish reversal based on AO Twin Peaks.")
3. Saucer Strategy
The Saucer strategy is a short-term momentum signal that uses three consecutive bars of the Awesome Oscillator (or two for the bearish signal) that are on the same side of the zero line but change color, indicating a subtle shift in momentum.
- Bullish Saucer: Occurs above the zero line.
- AO is above the zero line.
- The first bar is red (AO[2] < AO[1]).
- The second bar is red and lower than the first red bar (AO[1] < AO[2]).
- The third bar is green (AO > AO[1]).
- Bearish Saucer: Occurs below the zero line.
- AO is below the zero line.
- The first bar is green (AO[2] > AO[1]).
- The second bar is green and higher than the first green bar (AO[1] > AO[2]).
- The third bar is red (AO < AO[1]).
//@version=5
strategy("AO Saucer Strategy", overlay=true)
// Calculate Awesome Oscillator
aoValue = ta.ao()
// Plot AO as a histogram in a separate pane
plot(aoValue, title="AO", style=plot.style_columns, color=aoValue >= aoValue[1] ? color.new(color.green, 0) : color.new(color.red, 0), display=display.pane_only)
hline(0, "Zero Line", color=color.new(color.gray, 0), linestyle=hline.style_solid, display=display.pane_only)
// Bullish Saucer condition
// AO is above zero, previous two bars are red and decreasing, current bar is green
bullishSaucer = aoValue > 0 and aoValue[1] < aoValue[2] and aoValue[1] < aoValue and aoValue > aoValue[1]
// Bearish Saucer condition
// AO is below zero, previous two bars are green and increasing, current bar is red
bearishSaucer = aoValue < 0 and aoValue[1] > aoValue[2] and aoValue[1] > aoValue and aoValue < aoValue[1]
// Strategy entries/exits
if (bullishSaucer)
strategy.entry("Long", strategy.long)
if (bearishSaucer)
strategy.entry("Short", strategy.short)
Optimizing Awesome Oscillator Performance
To get the most from the Awesome Oscillator in Pine Script:
- Understand Bill Williams' Philosophy: The AO is best understood within Bill Williams' broader trading system, which focuses on market fractal geometry and the psychology of trading. It's often used in conjunction with his other indicators like Fractals and Alligator.
- Combine Signals: Do not rely on a single AO signal in isolation. For higher probability trades, look for confluence between AO signals (e.g., zero line crossover + saucer), or combine them with price action and other indicators.
- Multi-Timeframe Analysis: Confirm AO signals on a higher timeframe for broader trend context. A strong AO signal on a lower timeframe gains credibility if it aligns with the momentum bias of a higher timeframe.
- Market Conditions: AO tends to perform well in trending markets. In sideways or extremely choppy markets, its signals might be less reliable.
Common Awesome Oscillator Pitfalls
- Lag: Despite being a momentum indicator, AO uses SMAs, which inherently introduce some lag. It's not a leading indicator.
- False Signals in Ranging Markets: In consolidations, AO can frequently cross the zero line or produce false saucer/twin peaks signals.
- Subjectivity in Twin Peaks/Saucers: While the general rules are defined, precisely identifying peaks and troughs for the Twin Peaks strategy can sometimes be subjective without robust swing point detection.
- Not a Standalone Indicator: AO is part of a larger system. Using it in isolation without other tools can lead to less effective trading.
- No Fixed Overbought/Oversold Zones: Unlike RSI or Stochastic, AO doesn't have fixed overbought/oversold levels. Its extremes are relative to its own historical range.
Conclusion
The Awesome Oscillator is a powerful and visually intuitive momentum indicator available in Pine Script for TradingView. Developed by Bill Williams, it offers a unique perspective on market momentum by comparing short-term and long-term price midpoint averages. Whether used for identifying shifts across the zero line, spotting the nuanced Twin Peaks pattern, or leveraging the short-term Saucer signal, the AO provides valuable insights into the underlying forces driving price. By understanding its calculation and characteristic patterns, and integrating it strategically within your broader technical analysis framework, you can leverage the Awesome Oscillator to enhance your trading decisions and gain a clearer view of market dynamics.