Trend indicators

Williams Alligator Indicator: Formula, How to Read the Jaw, Teeth and Lips, the Gator Oscillator, and a Test on Real Prices

Bill Williams' Alligator from MetaTrader's documented formula: three smoothed moving averages of the median price shifted forward, how to read them, the Gator Oscillator built from them, and what the plain alignment rule did on daily Bitcoin and the S&P 500 ETF.

· Founder of PatternsWizard
Checked 9 min read
Alligator(13/8, 8/5, 5/3) on Bitcoin, daily, August 30, 2026 to October 28, 2026. Illustration of how the indicator reads, not a backtest.
On this page
  1. How the Alligator is calculated
  2. Sleeping, waking, eating: how to read it
  3. The Gator Oscillator
  4. A test of the plain rule
  5. The trades on the chart above
  6. Does it work?
  7. Frequently asked questions

The Williams Alligator is a set of three smoothed moving averages of the median price, each shifted forward in time: the Jaw (13 bars, shifted 8), the Teeth (8 bars, shifted 5) and the Lips (5 bars, shifted 3). It was introduced by the trader Bill Williams, and MetaTrader files it among his indicators. When the three lines are tangled, the "Alligator" is asleep and the market has no trend; when they fan out in order, Lips first, then Teeth, then Jaw, it is "eating" a trend. The Gator Oscillator draws the same three lines as two histograms of the gaps between them. Below we compute both on real daily prices and test the plain reading: trade when the lines are in order, stand aside when they are not.

Williams Alligator on daily Bitcoin

Alligator(13/8, 8/5, 5/3) on Bitcoin, daily, July 1, 2026 to October 28, 2026. Illustration of how the indicator reads, not a backtest.
  • Price, daily candles (hollow up, filled down)
  • Jaw, SMMA(13) of the median price, shifted 8 bars (dashed line)
  • Teeth, SMMA(8), shifted 5 (solid line, second color)
  • Lips, SMMA(5), shifted 3 (solid line)
Alligator(13/8, 8/5, 5/3) on Bitcoin, daily, July 1, 2026 to October 28, 2026. Illustration of how the indicator reads, not a backtest.

How the Alligator is calculated

Each line is a smoothed moving average (SMMA), the same running average Wilder used, applied to the median price, the midpoint of each bar's high and low. It is then drawn a few bars to the right of where it was computed, so the line at today's bar shows a value from several bars ago. The shift is what keeps the slow Jaw well behind price during a trend.

Sleeping, waking, eating: how to read it

LinesWilliams' metaphorWhat it means
Intertwined or close togetherAsleepNo trend; MetaTrader's help says to "refrain from working on markets that fluctuate only within certain price periods"
Lips crossing and pulling away from the other twoWaking, opening its mouthA move is starting
Lips above Teeth above Jaw, spreadingEating a bullUptrend
Lips below Teeth below Jaw, spreadingEating a bearDowntrend
Lines converging againFull, losing interestThe trend is fading; MetaTrader's help calls it the time to take profit

MetaTrader's help also states that clear trends can be seen only 15 to 30 percent of the time, which is the reason the Alligator spends so much time asleep. That figure is Williams' premise as MetaTrader reports it; we have not measured it.

The Gator Oscillator

The Gator Oscillator shows the same information as bars. Its upper histogram is the absolute gap between the Jaw and the Teeth; its lower histogram is the absolute gap between the Teeth and the Lips, drawn below zero. Both shrinking toward zero is the Alligator falling asleep; both growing is the Alligator eating. Because it uses absolute gaps, it tells you how open the mouth is, not in which direction.

Gator Oscillator on daily Bitcoin

Gator Oscillator(13/8, 8/5, 5/3) on Bitcoin, daily, July 1, 2026 to October 28, 2026. Illustration of how the indicator reads, not a backtest.
  • Price, daily candles (hollow up, filled down)
  • Upper, |jaw − teeth| (solid line)
  • Lower, −|teeth − lips| (dashed line)
Gator Oscillator(13/8, 8/5, 5/3) on Bitcoin, daily, July 1, 2026 to October 28, 2026. Illustration of how the indicator reads, not a backtest.

On the chart, the largest Jaw to Teeth gap of the window came on September 1, 2026, at 5,008.29, at the end of the August rally; the gaps then narrowed through October as the lines closed in on each other.

A test of the plain rule

We tested the simplest reading on our two daily series: go long at the next open when the lines line up as Lips above Teeth above Jaw, short when they line up the other way, and go flat at the next open as soon as the order breaks. Before costs, with the default settings, from the 87th bar of each series: the first 86 bars are a warm-up that lets the three smoothed averages settle. The test starts flat: on both markets the lines were already in bullish order on that first date, and that alignment under way is not taken; the first trade waits for a new alignment.

MarketBars in order up / down / mixedTradesWinningResultHolding
Bitcoin, from June 2, 2025190 / 205 / 119299−21.31%−23.16%
S&P 500 ETF, from October 10, 2024336 / 90 / 882815+17.89%+37.16%

All trades were closed by October 28, 2026; the ETF prices are dividend-adjusted. Holding runs from the first open the rule could trade, June 3, 2025 on Bitcoin and October 11, 2024 on the ETF, to the close of October 28, 2026. Trades lasted 13.6 bars on average on Bitcoin and 14.6 on the ETF. Brief alignments were a weak point on Bitcoin, not on the ETF. On Bitcoin, 9 trades lasted three bars or less and 7 of them lost, including the worst trade, a three-bar short at −21.03%; but most of the 20 losing trades were longer, and the brief ones made up about a third of the summed losses. On the ETF, 7 of the 10 trades of three bars or less won. The rule tracked holding on falling Bitcoin, and kept about half of the ETF's gain.

Alignment rule against buy and hold, before costs

Alignment rule against buy and hold, before costs. Bitcoin, June 3, 2025 to October 28, 2026: Alignment rule −21.31%, Holding −23.16%; S&P 500 ETF, October 11, 2024 to October 28, 2026: Alignment rule +17.89%, Holding +37.16%. Our computation; the inputs and the method are in the text.
  • Alignment rule
  • Holding
Our computation; the inputs and the method are in the text.Default settings (13/8, 8/5, 5/3), long or short at the next open on a new alignment, flat at the next open when the order breaks; trade returns compounded. Holding: from the first open the rule could trade to the last close. ETF prices dividend-adjusted.

The trades on the chart above

The chart shows daily Bitcoin from July 1 to October 28, 2026. On July 1 the lines were in bearish order and the rule was short, from May 26 at 77,322.01; the order broke on July 8 and the short was closed at the next open, 62,290.01, a gain of 19.44%. In the window that followed:

  • long from July 21 at 65,255.51 to August 1: −3.63%;
  • three quick trades in early August, while the lines kept tangling: long −0.08%, short −0.99%, long −0.81%;
  • short from August 19 at 64,725.42, after a bearish alignment on August 18; Bitcoin then rallied to a close of 78,338.03 on August 21 and the short was closed at the next open, at the same price: −21.03%;
  • long from August 25 at 78,992.76 to September 19 at 80,883.86: +2.39%;
  • long from September 22 at 86,620.01 to October 13 at 81,850.01: −5.51%;
  • short from October 23 at 81,416.09 to October 26 at 80,154.09: +1.55%; the rule was flat from then to October 28.

Every alignment trade closed in the chart window, daily Bitcoin

Every alignment trade closed in the chart window, daily Bitcoin. Short, May 26 to July 9: +19.44%; Long, July 21 to August 1: −3.63%; Long, August 3 to 4: −0.08%; Short, August 7 to 9: −0.99%; Long, August 12 to 16: −0.81%; Short, August 19 to 22: −21.03%; Long, August 25 to September 19: +2.39%; Long, September 22 to October 13: −5.51%; Short, October 23 to 26: +1.55%. Our computation; the inputs and the method are in the text.
Our computation; the inputs and the method are in the text.2026, entry and exit at the open of the dates shown; the first short was opened before the window and closed in it. Before costs.

The August short is the shift at work in reverse: the lines confirm a trend only after it has run, and a sharp turn hits the position before the slow Jaw can move.

To try the Alligator on your own charts, it is one of TradingView's built-in indicators: open a free TradingView account and add it from the indicator list. Click here to get started on TradingView for free.

Does it work?

We have no long-run measurement of the Alligator: our bench tests chart patterns detected by rule against random entries, not indicators (see our methodology). The test above is two markets over a year and a half (Bitcoin) and two years (the ETF), before costs, with a deliberately plain rule; it shows how often the lines line up and what a crude version cost, not what Williams' full method returns. For other smoothing tools see the moving average and the Hull moving average, or the full list of trend indicators.

Every pattern's results on one sheet

The only pattern cheat sheet with tested stats: 152 patterns, what the textbook says and what really happened on 6 markets. Free PDF, sent to your inbox.

The PDF by email, plus our newsletter: new tests and results that change. Unsubscribe anytime. Privacy.

Frequently asked questions

What are the Williams Alligator settings?

A 13-period smoothed moving average shifted 8 bars (Jaw), 8 shifted 5 (Teeth) and 5 shifted 3 (Lips), all on the median price (high plus low, divided by two).

How do you read the Alligator indicator?

Tangled lines: no trend, stay out. Lines spreading apart with the Lips above the Teeth above the Jaw: uptrend; the reverse order: downtrend. Lines converging again: the trend is fading.

What is the difference between the Alligator and the Gator Oscillator?

They use the same three lines. The Alligator draws them on the price chart; the Gator draws the gaps between them as two histograms, which makes it easier to see when the lines open or close, but drops the direction.

Why are the Alligator lines shifted forward?

Williams' definition moves each average a few bars to the right, so the slow lines sit further behind price in a trend. The effect is that a trend has to run for a while before the three lines line up.

Is the Williams Alligator profitable?

We have no long-run test. Trading every alignment to October 2026, from June 3, 2025 on daily Bitcoin and from October 11, 2024 on the S&P 500 ETF, lost 21.31% on Bitcoin, slightly less than holding over the same period (−23.16%), and gained 17.89% on the ETF, well below holding (+37.16%), before costs. On Bitcoin, 7 of the 9 alignments that lasted three bars or less lost, including the worst trade (−21.03%), but most losing trades were longer.

Sources

  1. MetaTrader 5 Help, Alligator
  2. MetaTrader 5 Help, Gator Oscillator
  3. MetaTrader 5 Help, Moving Average (smoothed moving average)
  4. TradingView Support, Williams Alligator
, Founder of PatternsWizard

Passionate about finance, quantitative trading and data analysis. Amaury built the PatternsWizard test bench, which detects each pattern on full price history and measures what happened next against random entries.

PatternsWizard tests chart and candlestick patterns on full market history, against random entries. How we test patterns.

179 patterns testedRandom-walk self-test passed

All trend indicators articles