The Alligator plots three smoothed moving averages, offset forward in time, directly on the price chart to show whether a market is trending or going nowhere. It was developed by Bill Williams, a trader who built his approach around chaos theory and market psychology, and he gave the indicator a memorable metaphor: like a real alligator, the market alternates between long stretches of sleeping (resting, ranging, doing nothing) and short bursts of waking up and feeding (trending hard). Most of the profit in a trending strategy comes from catching those feeding periods and avoiding the long naps in between — which is exactly the read the Alligator is built to give at a glance.
How the Alligator Is Calculated
The three lines are all built the same way — a Smoothed Moving Average (SMMA) of the median price (the midpoint of each candle's high and low) — but each uses a different period and is shifted forward into the future by a different number of bars, so they separate visually instead of overlapping:
- Jaw (blue) — 13-period SMMA, shifted 8 bars forward. The slowest line.
- Teeth (red) — 8-period SMMA, shifted 5 bars forward. The medium line.
- Lips (green) — 5-period SMMA, shifted 3 bars forward. The fastest line.
The shift is the part that makes the Alligator different from three ordinary moving averages plotted on top of each other. Because each line is displaced into the future by a different amount, they don't just sit at different distances from price — they spread apart and fan out as a new trend accelerates, and collapse back together as momentum fades. SMMA itself is a heavily smoothed average (each new value blends in only a small fraction of the newest price, similar in spirit to the smoothing used in RSI), which is what keeps the three lines calm and readable instead of jittering with every candle.
Reading the Alligator: Sleeping vs Awake
- Sleeping (lines tangled together) — Jaw, Teeth, and Lips overlap and repeatedly cross each other in a tight band. Price chops sideways through the tangle. Bill Williams' own advice was blunt: stay out of the market while the Alligator sleeps, because trades entered here mostly bleed out to spread and false signals.
- Waking up (lines start to separate) — the tangle loosens and the lines begin to fan outward in a consistent order, usually with Lips crossing away from Teeth first.
- Fully awake (lines fanned out in order) — in an uptrend, Lips sits above Teeth, which sits above Jaw, with price riding above all three (the mirror image — Lips below Teeth below Jaw — marks a downtrend). This ordered fan is the clearest visual confirmation that a real trend, not just noise, is underway.
The diagram above shows exactly this life cycle: a tangled, overlapping mess during the ranging phase on the left, then all three lines fanning out in the correct order as price breaks higher on the right.
Entry Conditions
The included custom indicator uses a simplified, mechanical version of the "waking up" signal — the crossover between Lips and Teeth, which tends to be the earliest line to move and therefore the earliest hint that sleep is ending:
- BUY signal — Lips crosses above Teeth after the lines have been tangled, especially if price is also trading above the Jaw.
- SELL signal — Lips crosses below Teeth after the lines have been tangled, especially if price is also trading below the Jaw.
That crossover alone is a decent early warning, but it fires often and not every crossover turns into a real trend — the fuller, more reliable read is the fan alignment described above. Many traders use the Lips/Teeth cross as a first alert, then wait for Jaw to join the fan in the same order before actually committing size, treating the crossover as "worth watching" and the full fan as "worth trading."
Parameters
- Jaw Period / Jaw Shift — default 13 / 8. Controls the slowest line; a larger period makes it react to bigger, longer-term swings.
- Teeth Period / Teeth Shift — default 8 / 5. The medium-speed line, usually the one price interacts with most during a healthy trend.
- Lips Period / Lips Shift — default 5 / 3. The fastest line and the first to move — the one this lesson's alert logic watches for crosses against Teeth.
- MA Method — default SMMA (Smoothed Moving Average), the method Bill Williams originally specified. Switching to a simple or exponential average makes the lines react faster but reintroduces more noise, defeating much of the point of the design.
- Applied Price — default Median Price (high + low, divided by two). Using the median instead of the close keeps the lines anchored to each candle's full range rather than just where it settled.
The 13/8/5 periods and 8/5/3 shifts are Bill Williams' original defaults, and shortening them makes the Alligator "wake up" faster but also tangle and re-tangle more often in a genuine range — a tradeoff between earlier signals and more false starts, the same tradeoff that shows up when tuning the period on any Moving Average.
Alligator vs a Simple Moving Average Cross
A three-MA crossover system (say, a 5/8/13 simple moving average triple) sounds like it should behave the same way, but the shift is what actually separates the Alligator from that kind of setup. Three unshifted moving averages sit on top of each other and constantly graze one another even in a calm market, because a short-period MA is always jittering around a longer one at close range. Projecting each Alligator line forward in time spreads them apart on the chart, so a genuine tangle (all three occupying the same tight band) looks visually distinct from a genuine fan (all three clearly separated and ordered) — the eye can tell sleeping from awake almost instantly, which is much harder to do with three overlapping, unshifted lines squeezed together. The tradeoff is that the forward shift means the rightmost few bars of each line are a projection into not-yet-formed price, not a lag-free real-time value — something to keep in mind when reading the very edge of the chart.
Combining with Fractals and the Awesome Oscillator
The Alligator was originally one piece of Bill Williams' broader trading system, not a standalone tool — in his method it's typically paired with Fractals (which mark potential swing highs/lows as candidate entry points) and the Awesome Oscillator (a momentum tool used to confirm a Fractal breakout has real strength behind it). The usual sequence is: wait for the Alligator to wake up and fan out, take a Fractal breakout in the direction of the fan, and use the Awesome Oscillator to filter out weak breakouts that lack momentum. This lesson focuses on the Alligator by itself, but it's worth knowing it was never meant to be traded entirely in isolation — the sleeping/awake read it gives is really the first filter in a three-part system, deciding whether the market is even worth looking at before the other two tools weigh in.
A Word of Caution
The single biggest mistake with the Alligator is trading the tangle — entering on a Lips/Teeth cross while the lines are still overlapping in a tight range produces exactly the whipsaws Bill Williams warned about, since sideways markets generate crossovers constantly with none of them meaning much. The safer read waits for a clear fan alignment, not just the first cross, before treating a signal as real. Like any moving-average-based tool, the Alligator is also inherently lagging — because SMMA smooths heavily and the lines are shifted forward, a full fan only confirms a trend after it's already underway, so entries based purely on the Alligator tend to be late relative to the actual turn. It reads range vs trend well (see Trend vs Range for the underlying concept it's built to visualize) but says nothing about when a trend will end, so it works best paired with a separate exit plan or a momentum filter like the Awesome Oscillator rather than used as a complete system on its own.
Download the Indicator
This custom indicator plots the Alligator's Jaw, Teeth, and Lips lines, with automatic alerts whenever the Lips cross the Teeth. It's available for both MetaTrader 4 and MetaTrader 5 below.
How to Install — MetaTrader 4
- Download the
alligator-alert.mq4file below. - Open MetaTrader 4 → click
File→Open Data Folder. - Place the file in the
MQL4/Indicatorsfolder. - Restart MetaTrader 4, then drag the indicator from the Navigator window onto the chart.
How to Install — MetaTrader 5
- Download the
alligator-alert.mq5file below. - Open MetaTrader 5 → click
File→Open Data Folder. - Place the file in the
MQL5/Indicatorsfolder. - Restart MetaTrader 5, then drag the indicator from the Navigator window onto the chart.
Both files are source code — open and review the full code before using it, for your own safety.