All posts
PublishedUpdatedByEvidence recordAlligatorBill Williamsmoving averagetrendindicatorbacktestUSD/JPY

Alligator Periods and Shifts: 1,584 Settings Tested

1,584 Alligator settings swept on USD/JPY with the forward shift taken out. The shift is a delay, not a forecast, and the mouth is open 80% of the year.

The Alligator's forward shift is a delay, not a forecast. On the published entry, lips crossing teeth, removing the shift gave the better annual result in 52 of 66 matched runs. With the default 13/8/5 on the hourly chart in 2025, the shifted lines made +115.5 pips over 404 trades and the unshifted ones +742.5 pips over 298.

Backtest this setup

The 13/8/5 periods themselves beat neighboring periods with no Fibonacci number in them in 136 of 288 one-to-one comparisons, below half.

The Alligator is three smoothed moving averages, named the jaw (13), teeth (8) and lips (5). When they are tangled the alligator is said to be sleeping; when they stack up in order and fan apart it is eating, and that is the trend you are supposed to ride. Each line is drawn eight, five and three bars to the right, so a line eight bars ahead carries the value it had eight bars ago.

The alligator is eating for four bars in five.

0%25%50%75%100%M15 202480.5485.89H1 202480.8586.02H4 202483.9688.34M15 202580.6286.62H1 202580.8686.45H4 202580.8886.73
displaced (Williams' original)no displacementUSD/JPY, share of bars with all three lines stacked
The Alligator is 'eating' for four bars in five. A condition that is true 80% of the time cannot filter much out.

Should you remove the displacement?

On the published entry, lips crossing teeth, removing the displacement gave the better annual result in 52 of 66 matched runs. The displacement is the forward shift of eight, five and three bars.

These are USD/JPY trades over 2024 and 2025 on 15-minute, hourly and four-hour bars with a 0.3-pip spread, with the reading and periods held fixed and only the displacement varied. The three readings are lips crossing teeth (trade when the 5-bar lips cross the 8-bar teeth), all three in order (hold while the lines stay stacked) and price outside all three (trade when a candle closes beyond every line).

05101520M15H1H4settings that did better with no displacement (of 22)
lips crossing teethall three in orderprice outside all threedashed line: 11 of 22, where the two are even
Out of 22 matched settings, how many finished ahead with the displacement removed. Across all 198 it is 103, close to half, but the lips-crossing-teeth entry Williams published did better without it on all three timeframes.
ReadingM15H1H4
Lips crossing teeth13/2219/2220/22
All three in order14/225/2212/22
Price outside all three1/228/2211/22

Each cell is 11 period sets × 2 years, counting how often removing the displacement finished with more pips.

Across all 198 it is 103: a coin toss. The displacement has no general effect.

But it splits by reading. On the published lips-and-teeth entry it is 52 of 66 in favor of removing it. On price-outside-all-three it is 20 of 66, so there the displacement earns its place.

The concrete version, hourly chart, periods 13/8/5, lips crossing teeth:

DisplacementYearTradesWin rateNet
None202529834.56%+742.5 pips
None2024——+2,944.9 pips
Half (4/3/2)202537444.39%+397.9 pips
Half (4/3/2)2024——+2,462.2 pips
Published (8/5/3)202540443.07%+115.5 pips
Published (8/5/3)2024——+973.7 pips
Double (16/10/6)202537048.11%+332.1 pips
Double (16/10/6)2024——+1,298.8 pips

Williams' displacement produced less net profit than no displacement in both years. In 2025, trades rose from 298 to 404 and win rate from 34.56% to 43.07%, while net fell from +742.5 to +115.5 pips.

The break-even spread makes it plainer. With the shift, 0.59 pips. Without it, 2.79. The first does not survive a 0.6-pip spread.

Price alone says the same thing

Measured without a strategy, on the move over the 10, 20 and 50 bars after each lips-teeth cross with the market's own drift taken out, the undisplaced lines gave the better forward move in 16 of 18 cells. They also cross less often: 294 times against 410 on the hourly chart in 2024. Delaying both lines produces more crossings, each followed by a smaller move.

What the Alligator is made of

All three lines are built the same way:

  1. Median price = (high + low) ÷ 2
  2. A smoothed moving average (SMMA) of it over 13, 8 or 5 bars
  3. Each line drawn 8, 5 or 3 bars to the right

The median price, the smoothed average and the displacement are all choices the author made.

The shift is a lag

The implementation is literal: compute the 13-bar SMMA at bar i, then draw that value at bar i + 8. Read the other way round, the jaw drawn at bar i is the average computed at bar i − 8.

No future data enters. Only age does. The displaced lines matched the undisplaced ones, shifted back by their own displacement, on every bar of all three timeframes in both years. A displaced line is an undisplaced line fetched from that far back.

Median price, and the smoothing

Swapping the price input or the averaging method, with no displacement, in 2025, changes the stacking order on this share of bars:

What changedBars where the stacking order changes
Median price → close3.7% to 4.6%
SMMA → EMA26.7% to 28.5%
SMMA → SMA41.4% to 45.2%

Lines that overlap almost perfectly still swap order on nearly half the bars. The three sit close together, so a small difference decides which is on top. Looking the same on the chart does not stop a different averaging method from changing when the trades happen.

Switching the median price to the close changes the order on 3.7–4.6% of bars; switching away from SMMA changes it on 26.7–45.2%. The smoothed average is the choice doing work here.

Setting it up and reading it

It ships with everything. Adding it draws three lines over the price candles.

PlatformWhere to add it
MT4 / MT5Insert → Indicators → Bill Williams → Alligator
TradingViewSearch the indicator list for Williams Alligator
Browser (Formiq)Pick "Alligator" from the indicator list

The eight fields in the settings dialog

MT4 opens it pre-filled with these. Every platform exposes the same eight.

FieldDefaultWhat it does
Jaw period13The slowest line: how many bars get averaged
Jaw shift8How many bars to the right that line is drawn
Teeth period8The middle line's period
Teeth shift5The middle line's displacement
Lips period5The fastest line's period
Lips shift3The fastest line's displacement
MA methodSmoothedA smoothed average, slower to react than a simple one
Apply toMedian price (HL/2)The midpoint of the bar's range, not the close

MT4 colors them jaw blue, teeth red, lips green by default. The names are only a metaphor; the maths is identical for all three. Slowest to fastest: jaw, teeth, lips.

Three lines, three market states

Everything the Alligator says comes from where the three lines sit relative to each other.

StateWhat you seeWilliams' name for it
SleepingThe three lines tangled and flatThe alligator sleeps. Stay out
AwakeningThe lines starting to separateThe mouth opens. Get ready
EatingLips above teeth above jaw, or the reverse, and spreadingThe alligator eats. Ride it

Eating upward means lips (green) on top and jaw (blue) at the bottom; downward is the mirror. Where this article says "stacked in order", that is the state it means.

How people trade it

The most widely published rule is: buy when the lips (5) cross above the teeth (8), sell when they cross below. This article measures that as "lips crossing teeth".

Other common readings:

  • Ride the stack: instead of the crossing moment, hold while the three stay in order
  • Ride the break: buy when a candle closes above all three lines, sell when it closes below

The lips-teeth cross, three-line alignment, and price outside all three lines are tested as separate trading rules.

Which fields are worth touching

Periods change how fast the lines move; shifts slide them sideways. The method and the applied price are editable too, and the article compares those on the lines themselves further down: swapping the smoothing changes the stacking order on 26.7–45.2% of bars, swapping the price input on 3.7–4.6%.

Where the shifts can be set to zero, that is the "three plain moving averages" version. This article compares the two.

How this was measured

ItemValue
PairUSD/JPY
Window2025-01-01 to 2025-12-31, with 2024 run identically for comparison
Timeframes15-minute / 1-hour / 4-hour
ReadingsLips crossing teeth / all three stacked in order / price closing outside all three
Period setsFibonacci ladder 5/3/2, 8/5/3, 13/8/5, 21/13/8, 34/21/13; controls 12/7/4, 12/7/6, 14/9/4, 14/9/6; jaw-only 11/8/5, 16/8/5 — eleven in all
Displacementnone 0/0/0, half 4/3/2, published 8/5/3, double 16/10/6
Combinations132 per cell; 3 timeframes × 4 windows = 1,584 runs
ExitThe opposite signal; entry and exit share one rule set
Stops and targetsNone in the main sweep, measured separately below
Spread0.3 pips fixed, filled at the close
Size0.1 lot

All three readings are symmetric (each one opens longs and shorts off mirror conditions) so entry and exit share a rule set.

How long does the alligator sleep?

For 16% to 19% of the year: the mouth was open on more than 80% of bars in all six cells. The share of bars with the three lines stacked in one direction, lips through jaw:

TimeframeYearStacked upStacked downIn orderTangled
M15202446.47%34.08%80.54%19.46%
H1202450.27%30.58%80.85%19.15%
H4202456.52%27.44%83.96%16.04%
M15202541.79%38.83%80.62%19.38%
H1202541.65%39.20%80.86%19.14%
H4202538.30%42.58%80.88%19.12%

Over 80% in all six cells, and 85.9–88.3% with the displacement removed. "Stay out while the alligator sleeps" means staying out for 16–19% of the year.

That is not a selective filter. The GMMA long ribbon was likewise in order on 85% of bars. Count how often a state occurs before measuring the trades it separates.

The up-and-down split tracks the market honestly. USD/JPY rose 1,632 pips in 2024 and the hourly split was 50.27% to 30.58%; 2025 closed 56 pips lower and the split was 41.65% to 39.20%.

Does the jaw period matter?

The standard entry never reads it. "Buy when the lips cross the teeth" reads the lips and the teeth. The jaw is not in it.

Three period sets sharing the teeth and lips, with the jaw moved:

Reading11/8/513/8/516/8/5
Lips crossing teeth (H1, 2025)+397+397+397
All three in order+357+306+483
Price outside all three+1,495+1,337+935

Identical to the pip on the first row. The 13-bar line the indicator is named around plays no part in its most popular entry.

The editor now hides the jaw period and jaw shift when the lips-teeth cross is selected, because neither parameter can change that rule's trades.

Do the Fibonacci numbers matter?

Jaw 13, teeth 8, lips 5; shifts 8, 5, 3. Every one is a Fibonacci number.

The comparison is four period sets with no Fibonacci number in them: 12/7/4, 12/7/6, 14/9/4 and 14/9/6, the four corners around Williams' teeth and lips.

Matched one-to-one across every trigger, timeframe, displacement and year, 13/8/5 finished ahead in 136 of 288. Below half.

TimeframeYearFibonacci ladder (5 sets)No Fibonacci number (4 sets)
M152025+435+865
M152024+937+1,178
H12025+707+734
H12024+1,399+1,293
H42025−982−952
H42024+1,709+2,055

The non-Fibonacci sets are ahead in five of six; the lone exception is the hourly 2024 row, +1,399 against +1,293. No effect specific to the Fibonacci numbers showed up, the same result as the Fibonacci retracement ratios measured by depth.

Which timeframe can you use it on?

The most settings profitable in both 2024 and 2025 came from the hourly price-outside-all-three reading: all 44.

ReadingM15H1H4
Lips crossing teeth35/4439/444/44
All three in order41/4427/441/44
Price outside all three22/4444/449/44

The four-hour chart inverted between the years: 40/44, 42/44 and 44/44 in 2024 became 4/44, 1/44 and 9/44 in 2025. GMMA and CCI both did this too.

Except in the first half of 2025

The same counts with 2025 split down the middle, hourly chart:

01122334420242025Jan–Jun 2025Jul–Dec 2025the right-hand pair is 2025 split in two
lips crossing teethall three in orderprice outside all threeH1, profitable settings out of 44
Each reading was profitable in 31 to 44 of its 44 settings in each full year, but in only 10 to 18 in January–June 2025. A full-year count hides what happened in each half.
ReadingWindowProfitable settings
Lips crossing teeth202442/44
Lips crossing teeth202541/44
Lips crossing teethFirst half 202511/44
Lips crossing teethSecond half 202544/44
All three in order202434/44
All three in order202531/44
All three in orderFirst half 202510/44
All three in orderSecond half 202534/44
Price outside all three202444/44
Price outside all three202544/44
Price outside all threeFirst half 202518/44
Price outside all threeSecond half 202543/44

44 of 44 is an 18-of-44 half added to a 43-of-44 half. "Profitable in both years" and "profitable throughout" are different claims.

Concretely: 13/8/5 with the published shift, price outside all three, hourly: 361 trades and +969.3 pips over 2025, made of −673.5 over 212 trades in the first half and +1,618.7 over 150 in the second.

All three readings decline together, so this is not specific to one reading. The annual figure hides the difference between the two halves.

Why the lowest win rate won

Its mean win ran 2.6 times its mean loss. Hourly chart, 2025, settings with at least one trade:

ReadingMean win rateMean winMean lossMean holdProfitable
Lips crossing teeth42.8%+56.5−38.626.7 bars41/44
All three in order41.1%+76.8−50.751.9 bars31/44
Price outside all three30.4%+76.7−29.224.6 bars44/44

Price outside all three has the lowest win rate and 44 of 44 profitable settings, because its average win is 2.6 times its average loss.

Does a wider mouth precede a bigger move?

When the three lines were widest apart at entry, the move over the next 20 bars, up or down, was the largest on all three timeframes:

TimeframeNarrowest gapNarrowerWiderWidest gapAll bars
M1524.6928.3928.8634.7529.17
H157.5361.9159.4273.0662.98
H4116.48125.60127.92133.64125.92

The narrowest gap is below the all-bars average everywhere.

Read it carefully, though. The lines are apart because price just moved, so this is volatility persisting, not direction being predicted, and the edge is +19% on the 15-minute chart.

Filters, stops and cost

An ADX filter breaks it, for the fourth time

ReadingDisplacementTimeframeYearADX conditionTradesNet
Lips × teethOnH12025None404+115.5 pips
Lips × teethOnH12025≥ 20182+121.8 pips
Lips × teethOnH12025≥ 25100−1,175.1 pips
Lips × teethOnH12025≥ 3050−695.5 pips
Lips × teethOffH12025None298+742.5 pips
Lips × teethOffH12025≥ 20128−116.2 pips
Lips × teethOffH12025≥ 2573−137.6 pips
Lips × teethOffH12025≥ 3035−101.7 pips
Price outside all threeOnH12025None361+969.3 pips
Price outside all threeOnH12025≥ 20224+715.2 pips
Price outside all threeOnH12025≥ 25161−568.6 pips
Price outside all threeOnH12025≥ 30111−1,056.5 pips

Filtering a trend rule for trend duplicates the condition. GMMA and CCI found it first; this is the fourth time.

Stops and targets

A 100-pip stop with a 200-pip target improved both years on the crossing entry: no displacement went +742.5 → +2,242.8 in 2025 and +2,944.9 → +3,172.2 in 2024, and with the displacement +115.5 → +624.6 and +973.7 → +1,232.6.

It does not carry to the other readings. Price-outside-all-three went +969.3 → +1,255.3 in 2025 but +2,161.6 → +2,002.2 in 2024. Of the four settings measured, only the two crossing variants improved in both years.

Cost

Net pips fall linearly with the spread. Pips lost = trades × spread, with no error.

SettingTradesSpread 00.31.0Break-even
Lips × teeth, displaced, H1404+236.7+115.5−167.30.59 pips
Lips × teeth, no shift, H1298+831.9+742.5+533.92.79 pips
Price outside all three, H1361+1,077.6+969.3+716.62.99 pips

Removing the displacement moved the break-even from 0.59 pips to 2.79. 106 fewer trades to pay for, and more pips in each one.

Notes

  • One pair, two years. The Alligator came from commodity futures; on another market even the share of time the mouth is open would change
  • Every trade used the smoothed average. Switching SMMA to EMA changes the stacking order on 27–29% of bars, so with a different method these results do not apply
  • The spread is fixed at 0.3 pips. A setting with 0.59 pips of room does not survive that assumption breaking
  • The mouth-width result has no direction in it. It is an absolute move, so it says "bigger", not "up"
  • The four-hour chart traded only 25 to 290 times a year depending on the reading, and reversed completely between 2024 and 2025, so its figures deserve less weight than the other timeframes'

Questions people ask

What are the best Williams Alligator settings?
In this test the reading mattered more than the numbers. On the hourly chart, taking price closing outside all three lines as the signal was profitable in 44 of 44 settings in 2024 and 44 of 44 in 2025, but only 18 of 44 in the first half of 2025 alone. The published 13/8/5 periods did not beat non-Fibonacci periods next to them: matched one-to-one, 13/8/5 won 136 of 288.
What does the Alligator's forward shift do?
It delays the lines rather than projecting them. A line pushed eight bars forward carries the average as it stood eight bars ago, so reading it today means reading older rather than newer data. Measured directly, the displaced jaw equals the undisplaced jaw eight bars earlier on every bar tested. Removing the displacement improved 103 of 198 matched settings, which is a coin toss overall; on the published lips-and-teeth entry it improved 52 of 66.
How often is the Alligator sleeping?
Between 16% and 19% of the year. The three lines are stacked in one direction (the 'eating' state) on 80.5% to 84.0% of bars across three timeframes and two years, and on 85.9% to 88.3% once the displacement is removed. A state that holds four bars in five cannot filter much.
Do the Alligator's Fibonacci periods matter?
Not measurably. 13/8/5 was compared one-to-one against four control sets containing no Fibonacci number (12/7/4, 12/7/6, 14/9/4, 14/9/6) at every trigger, timeframe, displacement and year. It finished ahead in 136 of 288, which is below half.
Is the Alligator built into MT4?
Yes. In MT4 and MT5 it is Insert → Indicators → Bill Williams → Alligator, where the three periods, the three shifts, the averaging method (Smoothed by default) and the applied price (Median Price by default) are all editable. TradingView has it as Williams Alligator. Formiq has it on the chart and in the backtester, where three readings and the six numbers can all be used as conditions.

Formiq is a free browser-based FX terminal with replay practice and no-code backtesting. Open the chart or see what the free plan includes.