← Back to Home
Trading Signal / Indicator
🐊

Williams Alligator Indicator

Three smoothed moving averages that identify when the market is trending or sleeping.

Start Automating Free →

Want to automate this strategy? Try auto-Trading free — no credit card required.

Williams Alligator Indicator chart

Overview

What is Williams Alligator Indicator?

The Alligator indicator, developed by Bill Williams, consists of three Smoothed Moving Averages (SMAs) with distinct periods and forward offsets, each named after parts of an alligator: the Jaw (13-period SMMA, shifted 8 bars forward), the Teeth (8-period SMMA, shifted 5 bars forward), and the Lips (5-period SMMA, shifted 3 bars forward).

The metaphor is apt: when all three lines are intertwined and flat, the alligator is "sleeping" — the market is ranging and not suitable for trend-following strategies. When the lines diverge and begin to separate, the alligator is "awakening" — a trend is beginning. When the lines are widely spread and moving together, the alligator is "eating" — the trend is in full swing and momentum is strongest.

Trading rules: enter long when the Lips cross above the Teeth, which crosses above the Jaw (all three lines fanning upward). Enter short when the Lips cross below the Teeth, which crosses below the Jaw. Exit when the lines begin to converge again (the alligator is "sated"). The beauty of the indicator is that it simultaneously identifies both trend direction and trend strength.

The offset feature is key: the forward shift means each line represents what would have been the average of those bars projected forward in time — making the Alligator a unique leading/confirming indicator hybrid rather than a purely lagging one.

How It Works in auto-Trading

Automate It

auto-Trading computes all three Alligator lines with their correct SMMA periods and forward offsets. The strategy builder supports crossover triggers between Lips/Teeth/Jaw for entries, convergence detection for exits, and sleeping/eating market state classification. The Alligator integrates natively with the Awesome Oscillator and Fractal blocks for a complete Bill Williams system.

Try Free →

Strategy Code

Pick a script below, copy it, and use it on your chart.

Pine Script (TradingView)

This is a TradingView Pine Script example for this indicator. Paste it into the TradingView Pine Editor, add it to your chart, and adjust inputs for your market and timeframe.

//@version=6
strategy("Williams Alligator Indicator", overlay=true)
fastLen = input.int(20, "Fast Length")
slowLen = input.int(50, "Slow Length")
fast = ta.ema(close, fastLen)

Get full strategy code access

Enter your email address and full name to unlock this strategy code.

ThinkScript (thinkorswim)

This is a thinkorswim ThinkScript example for this indicator. Open thinkorswim, create a custom study, paste the script, and apply it to your chart.

def jaw = SmoothedAverage(close, 13);
def teeth = SmoothedAverage(close, 8);
def lips = SmoothedAverage(close, 5);
def buySignal = lips > teeth and teeth > jaw;
def sellSignal = lips < teeth;

Get full strategy code access

Enter your email address and full name to unlock this strategy code.

Ready to automate Williams Alligator Indicator?

Join thousands of traders who use auto-Trading to execute this strategy automatically, 24/7.

Get Started Free →

All Strategies & Signals

Continue Learning

Trading Strategies

Trading Signals & Indicators