Alligator Indicator
The Alligator turns three moving averages into a metaphorical beast: the order in which lips/teeth/jaw open is the rhythm of a trend from birth to full stride.
What it is
The Alligator indicator, invented by Bill Williams, consists of three smoothed moving averages (SMMA 13/8/5), each shifted forward (8/5/3 bars): the Jaw (13, shift 8), the Teeth (8, shift 5) and the Lips (5, shift 3). Williams's metaphor: a "sleeping" alligator (lines entangled) is a ranging market; "opening its mouth" (lines fanning out in order) is a trend starting; "feeding" is the trend in progress; "closing its mouth" is exhaustion. The shifts make the three lines layer naturally, filtering the false signals of tangled averages.
Origin
The Alligator comes from Bill Williams's chaos-trading framework (same family as Fractals, AO and Gator), central to his books "Trading Chaos" (1995) and "New Trading Dimensions" (1998). The framework reads markets through fractals-chaos-self-organization — the Alligator answers "what phase is the market in" (sleeping/waking/feeding), while Fractals and AO answer "where to act and whether".
Download Camovia Tray free — check quotes, manage positions, and hide in one click from your system tray.
Download FreeThe formula
The three lines (MT5 defaults):
The HL midpoint is (High+Low)÷2 — not the close. SMMA is Wilder smoothing (same as RSI/ATR). The forward shifts are the Alligator's signature: drawing each line into the future pre-fans the trio into the "open mouth" shape and estimates where support/resistance will sit over the next bars.
Worked example
Reading the alligator's three phases:
- Sleeping: the three lines tangle sideways — a range; all trend strategies stand down (Williams explicitly says: do not trade a sleeping alligator).
- Opening: the Lips (5) cross above the Teeth (8) then the Jaw (13), the lines fanning in order — trend-start signal, trade in the direction of the "mouth".
- Feeding: the lines fan out and hold their separation while price rides the Lips — the holding phase; the Lips double as a dynamic trailing stop.
The Alligator's core value is making regime-reading visual — entangled vs fanned is instantly obvious, more intuitive than counting ADX. Its entry signal (mouth direction) and exit reference (Lips) come as a matched pair.
How to read it
Relative line positions and phase calls:
| Range | Common interpretation |
|---|---|
| Lines tangled | The alligator sleeps — a range; no trend trades; fractal breakouts may be brewing |
| Bullish stack (Lips > Teeth > Jaw) | Mouth open upward — an uptrend in progress; the Lips is the pullback reference for entries |
| Bearish stack (Lips < Teeth < Jaw) | Mouth open downward — a downtrend in progress |
| Lines converging | The alligator closes its mouth — trend exhaustion; protect profit |
| Price far from all lines | Overextension — the trend is stretched; reversion risk to the lines is high |
Versus a plain MA stack (e.g. 5/10/20 EMA) three things differ: SMMA (smoother), HL midpoints (intraday info), and forward shifts (future S/R). Together they make "open/closed mouth" earlier and clearer than plain MA crosses.
Common signals & usage
Mouth-open entry (with Fractal confirmation)
The Lips crossing above Teeth/Jaw while price breaks the latest fractal — the full Williams-system entry: the Alligator sets direction, the Fractal triggers.
Lips pullback entry
In an uptrend, price retesting the Lips and holding — the trend-continuation entry (a reinforced MA5-pullback).
Mouth-closing exit
The lines beginning to converge and cross — trend exhaustion; exit or tighten stops without waiting for a reverse stack.
First open after a long sleep
The first mouth-opening after a long tangle — the coiled-spring breakout, the highest-quality entry in the Williams system.
Limitations & common mistakes
- Insufficient alone: the Alligator answers "what phase", not "where to enter" — by design it requires Fractals and AO alongside.
- The shifted-lines illusion: the lines are drawn into the future, so their crossing point with new bars is not a live signal — use the unshifted value at the current bar.
- SMMA lag: 13-period Wilder smoothing plus an 8-bar shift makes the Jaw blunt — short-term traders will find it slow; that is design intent, not a bug.
- Blind to V-turns: the Alligator is a trend system — in sharp V-reversals the lines cannot fan in time, confirming only after the move is done.
- The parameter set is locked: 13/8/5 with shifts 8/5/3 are the system's parameters — retuning them means leaving the framework.
Alligator in MT5
The Alligator is a built-in MT5 trend indicator (three lines on the main chart). The MQL5 function for programmatic use is iAlligator:
| MQL5 function | iAlligator() |
| Default parameters | Jaw 13/8, Teeth 8/5, Lips 5/3 (period/shift) |
| Default smoothing | MODE_SMMA (Wilder smoothing) |
| Buffers | 0=GatorJaw, 1=GatorTeeth, 2=GatorLips |
| Display window | Main chart, three-line overlay |
The buffer names carry the Gator prefix (shared data structure with the Gator Oscillator). iAlligator exposes every period and shift — keep defaults to stay inside the Williams system. Whether a buffer returns the unshifted current-bar value or the shifted display value depends on implementation — for logic, prefer the raw buffer values.
Behavior across timeframes
15-minute
Sleep/open cycles churn fast — skip the sleeping phase entirely, take only the first wave after opening
1-hour / 4-hour
The swing main field: mouth-open + fractal confirmation is the classic combo here
Daily
The framework's native habitat: daily "feeding" phases often run weeks to months
Weekly
A weekly mouth-opening is a quarter-scale trend — the coarsest filter for long-term holding direction
Indicator combinations
The standard Williams-system pairings:
- With Fractals: the Alligator sets direction (the side the mouth opens), fractal breakouts trigger — the system's core two-piece kit. FRACTALS
- With AO: the Alligator reads the phase, AO reads momentum acceleration — the framework's regime plus momentum gauges. AO
- With ATR: Alligator direction + 2×ATR stops — the Williams framework has no risk module; ATR fills it. ATR
FAQ
Q What are the three Alligator lines?
The Jaw = 13-period SMMA of the HL midpoint shifted 8 bars, the Teeth = 8-period shifted 5, the Lips = 5-period shifted 3. The decreasing periods (slow/mid/fast) map to the jaw-teeth-lips anatomy, and the shifts make the lines fan out naturally in trends.
Q Why are the lines shifted forward?
Williams's intent: the shifts pre-fan the trio into the "open mouth" shape so trend starts are visually instant, and the shifted lines double as near-future support/resistance estimates. The cost: their crossing points with new bars are not live signals — mind the distinction when reading.
Q What should I do when the alligator sleeps (lines tangled)?
Williams's own words: do not trade a sleeping alligator — in a range, trend signals are all noise. The correct action: watch, or wait for the first mouth-opening after the tangle plus a fractal breakout (the highest-quality signal in the system).
Q How is the Alligator different from a plain MA stack?
Three things: SMMA (Wilder) is smoother than EMA/SMA; it uses HL midpoints rather than closes; and the forward shifts (8/5/3) layer the lines. Together they make the open/closed-mouth shape earlier and more visual than plain MA crosses — though it is still an average-based system at heart.
Q How do I add the Alligator in MT5?
Menu: Insert → Indicators → Trend → Alligator, or drag it from the Navigator onto the main chart. The dialog exposes Jaw/Teeth/Lips periods and shifts (defaults 13/8, 8/5, 5/3) with SMMA smoothing on the Median price (HL/2) — keep defaults for the original system.
Turn MT5 / MT4 into a Tray Tool
Check quotes, manage positions, and hide in one click.
Download Camovia TrayThis page is educational content about a technical indicator. It is not investment advice. Indicator signals can and do fail — always combine them with your own risk management.