The Williams Alligator indicator starts from an uncomfortable idea: most of the time, the market isn’t going anywhere. Bill Williams built it to keep traders out of those dead stretches and get them on board when a real trend finally shows up. It is three moving averages, nudged forward in time, and the way they tangle or fan out tells you which mood the chart is in.
We’ll cover what the three lines are, how each one is calculated, why they are shifted ahead of price, and then run a worked example on a hypothetical stock so you can see the numbers move. If you are new to indicators in general, our guide to technical analysis for Indian stocks is a good place to start first.
In this article
- What the Williams Alligator indicator is made of
- How the smoothed moving average works
- Why the lines are pushed into the future
- The four moods of the Alligator
- Worked example: XYZ wakes up
- Using the Williams Alligator indicator on Indian stocks
- A simple rule set to test
- Where the Alligator bites back
- The short version
What the Williams Alligator indicator is made of
Three lines, each a smoothed moving average (SMMA) with a different length. The periods are 5, 8 and 13, all Fibonacci numbers, as both Investopedia and TradingView’s help centre point out. Williams gave each one a body part:
- Jaw (blue line): a 13-period SMMA, shifted 8 bars into the future. The slowest line.
- Teeth (red line): an 8-period SMMA, shifted 5 bars forward.
- Lips (green line): a 5-period SMMA, shifted 3 bars forward. The fastest line.
The shift values come from the MetaTrader 5 help page on the Alligator, which writes the jaw as SMMA(median price, 13, 8): data, smoothing period, then shift. Some write-ups describe the second number loosely as “smoothed by eight bars”. On the platforms you will actually use, it is a forward displacement of the line on the chart.
The MetaTrader help page also quotes Williams’ starting premise. In his view, markets trend only around 15 to 30% of the time and spend the rest of it drifting sideways. The Alligator is his tool for telling those two states apart.
How the smoothed moving average works
An SMMA is a slow, sticky cousin of the simple moving average. The first value is just a plain average of the last N prices. After that, each new value keeps most of the old one and lets in only a small slice of the latest price.
The formula Investopedia and TradingView both give:
- First value: SMMA1 = SUM(price, N) / N
- Later values: SMMA(i) = (PREVSUM − SMMA(i−1) + price(i)) / N, where PREVSUM = SMMA(i−1) × N
Simplify that and you get something easier to do by hand: SMMA(i) = (SMMA(i−1) × (N−1) + price(i)) / N. With N = 5, the new value is four parts old line and one part today’s price, divided by five.
Which price goes in? MetaTrader uses the median price of each bar, (high + low) / 2. Investopedia and TradingView write their formula on closing prices. Many platforms let you change the input in settings. Just know which one your platform is using, because the lines will sit in slightly different places.
The Alligator doesn’t predict a trend. It waits for one to start, then tells you to stay out of its way when it ends.
Why the lines are pushed into the future
This part confuses people the first time they add the indicator. On a live chart, the three lines extend past the last candle: the lips by 3 bars, the teeth by 5, the jaw by 8. Nothing is being forecast. The line drawn on tomorrow’s slot is simply today’s average, slid to the right.
Shifting does two things. It spaces the lines further apart once a move gets going, so the “open mouth” is easier to spot. And it means price has to travel clear of an average that was calculated several bars ago, which filters out some of the noise. The cost is lag, which we’ll come back to.
The four moods of the Alligator
Williams described the indicator through the animal’s behaviour, and the labels have stuck. Investopedia and TradingView both use them:
- Sleeping: the three lines are tangled and criss-crossing. The market is choppy. Williams’ advice was to sit on the sidelines.
- Awakening: the lips cross through the other two lines. An upward cross is read as a possible buy; a downward cross as a possible short.
- Eating: the lines stretch apart and move together in one direction, mouth wide open. This is the trend, and existing positions are held and managed.
- Sated: the lines converge into a narrow band and flatten out. The trend may be ending, so it’s time to book profits or realign positions.
In an uptrend, the order from top to bottom is price, then lips, teeth and jaw. In a downtrend it flips. When the order scrambles, the alligator is going back to sleep.
Worked example: XYZ wakes up
Let’s build the lines for a hypothetical stock, XYZ, on daily candles. We use median prices, the MetaTrader convention. All prices are invented for illustration.
Step 1: the quiet stretch
For the first 12 sessions, XYZ trades in a tight box. Its daily median price bounces between ₹499 and ₹503. Bar 1 has a high of ₹503 and a low of ₹497, so the median is ₹500. The first five medians are ₹500, ₹501, ₹499, ₹502 and ₹500.
The first lips value (5-period SMMA) at bar 5 is a simple average: (500 + 501 + 499 + 502 + 500) / 5 = ₹500.40.
Bar 6 has a median of ₹503. The next lips value is (500.40 × 4 + 503) / 5 = ₹500.92. See how little it moved? A ₹2.60 jump in price above the line pulled it up by only about 52 paise.
The first teeth value (8-period SMMA) at bar 8 is the average of the first eight medians: 4,008 / 8 = ₹501.00. The jaw needs 13 bars, and its first value at bar 13 works out to ₹501.38.
Through bar 12, the raw lips value stays between ₹500.40 and ₹501.41 and the teeth between ₹500.88 and ₹501.23. Roughly a rupee of separation, lines overlapping. That’s a sleeping alligator.
Step 2: the breakout
From bar 13, XYZ starts climbing. Medians run ₹504, ₹508, ₹513, ₹518, ₹522, ₹527, ₹531, ₹535, then ₹538 at bar 21. The fast line reacts first. Raw lips go from ₹501.93 at bar 13 to ₹524.26 at bar 21, while the jaw has only crawled from ₹501.38 to ₹512.93.
Step 3: what you’d actually see on the chart
Now apply the shifts. On bar 21’s slot, the chart plots the lips calculated 3 bars earlier, the teeth from 5 bars earlier and the jaw from 8 bars earlier:
- Lips (from bar 18): ₹513.84
- Teeth (from bar 16): ₹505.50
- Jaw (from bar 13): ₹501.38
Price at ₹538 sits above all three, and they are stacked in the right order. The gap between lips and jaw is ₹12.46. Move to bar 24 and the plotted values are ₹524.26, ₹512.61 and ₹503.92. The gap has widened to ₹20.34. The mouth is opening, which is the “eating” phase.
Step 4: the first sign of fullness
Look at what price did near the end. Medians went ₹538, ₹538, ₹536, ₹533 over bars 21 to 24. The rally has stalled. But the plotted lines are still rising, because they are made of older data. That’s the lag in action. A trader using only the Alligator would still be holding here, and would only get the “sated” signal once the lips roll over and start closing in on the teeth, some bars later. By then, a chunk of the gain may already be gone.
Every signal the Alligator gives is built from prices that are already a few sessions old. That’s the price of filtering out noise.
Using the Williams Alligator indicator on Indian stocks
The indicator works on any market and timeframe. Investopedia suggests weekly charts for position traders, 30-minute to four-hour charts for swing traders, and one-minute to 15-minute charts for day traders. A few things are worth keeping in mind when you take it to NSE charts.
Pick liquid names. Thinly traded small caps produce gappy, erratic candles. The median price jumps around and the lines tangle even when there is a real move underneath. Index heavyweights and F&O stocks tend to give cleaner readings.
Mind the results calendar. A stock can look sound asleep for weeks before earnings and then gap 8% on the day. The Alligator will “awaken” after the gap, not before it. Treat a signal that appears the morning after results differently from one that builds over several sessions.
Use it to stay out, not just to get in. Its most useful job is often telling you a stock is range-bound. If the lines on Nifty or a stock you follow are knotted, you have a ready-made reason not to force a breakout trade.
Pair it with something. Investopedia lists RSI, MACD, the average directional index, the stochastic oscillator and pivot points as common companions, and mentions Williams’ own fractals. A momentum tool helps you judge whether an awakening has energy behind it. Our explainer on the stochastic RSI indicator covers one such option. For managing an exit once a trend is running, a trailing stop such as the chandelier exit fills the gap the Alligator’s lag leaves.
A simple rule set to test
This is a starting framework for paper trading or backtesting, not a system to trade as-is:
- Wait for the lines to be tangled for at least a few weeks. No trade while they are.
- Go long when price closes above all three lines and the lips cross above the teeth and jaw, with lips over teeth over jaw.
- Confirm with one momentum tool, such as RSI turning above 50 or MACD crossing its signal line.
- Place a stop below the jaw or below the most recent swing low, whichever you can live with.
- Exit, or tighten the stop, when price closes back below the lips and the lips turn down towards the teeth.
Flip it for shorts. Then test it on a few years of daily data for stocks you actually trade. You will likely find the rules make money in trending years and bleed slowly in choppy ones. That’s the indicator’s nature, so plan position sizes around the losing streaks.
Where the Alligator bites back
- Lag. Investopedia is blunt that it’s a lagging tool. Our XYZ example showed the lines still rising after price had stalled.
- Whipsaws in ranges. When the lines repeatedly crisscross, the indicator throws false signals, and many awakening signals inside big ranges fail. TradingView and Investopedia both flag this as its main drawback.
- Settings matter. Change the periods or shifts and you get a noticeably different indicator. Fiddling with them until a backtest looks good is a trap; Investopedia counts over-adjusting the parameters among the common pitfalls.
- Median versus close. Two traders looking at “the Alligator” on the same stock can see slightly different lines if their platforms use different price inputs.
The short version
The Williams Alligator indicator is three smoothed moving averages of 13, 8 and 5 periods, shifted forward by 8, 5 and 3 bars and named the jaw, teeth and lips. Tangled lines mean a sleeping, range-bound market. Lines fanning out in order mean a trend is running. Lines folding back together mean it’s tiring. It’s good at keeping you out of chop and on board a trend, and slow at telling you when to leave, so give it a partner for confirmation and a proper stop for exits.
Disclaimer: This article is for education only and is not investment advice or a recommendation to buy or sell any security. The stock and prices in the worked example are hypothetical. Indicators can give false signals, so test any approach carefully and speak to a SEBI-registered adviser before trading.

Leave a Reply
Join the conversation
Commenting is open to registered readers. Sign up with just your email — no password needed, and it takes under a minute.
Sign up to comment Log in