YoForex AI educational guides
Alligator indicator: jaw, teeth and lips, with the Gator Oscillator on MT5
The Alligator indicator is a Bill Williams tool made of three smoothed moving averages of median price, each shifted forward: a 13-period jaw, an 8-period teeth and a 5-period lips. MetaQuotes lists it in its Bill Williams' Indicators group. Because each line is a smoothed average, the lines react after price has moved.
Published · Updated · By YoForex AI Editorial Team
What is the Alligator indicator?
The Alligator indicator is one of the tools in the set of Bill Williams' indicators. It draws three lines on the price chart. MetaQuotes describes it as a combination of balance lines that use fractal geometry and nonlinear dynamics. The same page says that the market generates clear trends for only some 15 to 30 percent of the time. Its MetaTrader 5 help page sits in a group that lists the Alligator, the Fractals and the Gator Oscillator as Bill Williams' indicators available in the trading platform.
The three lines are the jaw (blue), the teeth (red) and the lips (green). Each one is a smoothed moving average of the median price, which is (high + low) / 2 for each bar, shifted forward so it sits to the right of the bars it was calculated from. The lines do not show where price will go. They show how the averages are ordered and spaced at the moment you look at them.
How are the Alligator lines calculated?
MetaQuotes writes each line as SMMA (median price, period, shift), where SMMA is the smoothed moving average. The table sets out the three lines with the period and forward shift from the MetaQuotes formulas, and the input names used in the MQL5 documentation for the same indicator.
| Line | Smoothed period | Forward shift | MQL5 input names |
|---|---|---|---|
| Jaw (blue) | 13 bars | 8 bars | jaw_period, jaw_shift |
| Teeth (red) | 8 bars | 5 bars | teeth_period, teeth_shift |
| Lips (green) | 5 bars | 3 bars | lips_period, lips_shift |
The MQL5 documentation example for iAlligator declares these numbers as its input defaults, together with MODE_SMMA as the averaging method and PRICE_MEDIAN as the applied price. The MetaQuotes Alligator page gives the same periods and shifts in its formulas but does not label them as defaults. Check the values in your own terminal before you compare a chart with this page.
How do you read the Alligator lines?
The MetaQuotes Alligator page gives a narrative reading rather than a numeric rule. In that reading, closed or intertwined lines mean the Alligator is going to sleep or is asleep already. When it wakes, it first opens its mouth and yawns, and then hunts. The page also says that when the lines join together, it is time to take profit. The rule below is this guide's own reading. When the lips are above the teeth and the teeth are above the jaw, the order fits an uptrend. The reverse order fits a downtrend. When the three lines tangle together and stay close, the chart is ranging by that reading, and the indicator has little to say.
Two checks matter more than the order alone. First, look at whether the lines are spreading apart, and whether price stays on one side of them. Second, check whether the same order holds on the timeframe above. A pattern on a fifteen-minute chart can look ordered while the daily chart is flat. Write down the timeframe with every reading, because the lines change with it. The EMA and SMA guide covers how the averaging method changes the way a moving average responds to price, which applies here too.
What does the Gator Oscillator show?
The MetaQuotes Gator Oscillator page says the indicator is based on the Alligator and shows the degree of convergence or divergence of its balance lines. It draws two histograms from the same three lines. The upper histogram is the absolute difference between the blue jaw and the red teeth. The lower histogram is the absolute difference between the red teeth and the green lips, shown with a minus sign, as MetaQuotes says, because the histogram chart is drawn top-down.
Bars that grow mean the lines are moving apart. Bars that shrink mean they are converging. The MetaQuotes page does not give color rules for the histogram bars, so do not assume that a color carries a meaning until you read the indicator properties in your own terminal. The oscillator is built from the same averages, so it lags in the same way and adds no separate view of direction.
How do Fractals fit with the Alligator?
Fractals are a separate Bill Williams indicator in MT5. The MetaQuotes Fractals page gives the definition of the fractal pattern, and this guide does not repeat it.
The same MetaQuotes page ties the two tools together. It says fractal signals need to be filtered with the Alligator. In its wording, you should not close a buy transaction if the fractal is lower than the Alligator's Teeth, and you should not close a sell transaction if the fractal is higher than the Teeth. It adds that a fractal signal beyond the Alligator's mouth stays in force until it is attacked, or until a more recent fractal signal emerges.
That is the source's description, not a tested rule. On this page, Fractals have one job: to mark swing points that you compare with the red Teeth line. Write down which side of the Teeth a fractal must sit on before you count it, and test that rule forward.
How do you set up the Alligator and Fractals in MT5?
MetaQuotes files these tools under Price Charts, Technical and Fundamental Analysis, then Technical Indicators, then Bill Williams' Indicators. The setup below uses that group.
- Check the Bill Williams' Indicators list on the MetaQuotes help page and confirm that the Alligator, Fractals and Gator Oscillator entries appear in your terminal.
- Add the Alligator to the chart, then set the jaw to 13 with shift 8, the teeth to 8 with shift 5, and the lips to 5 with shift 3, all on SMMA and median price.
- Add the Gator Oscillator if you want the histograms, and add Fractals to the price chart.
- Open the indicator properties and check that each value matches the table above before you read any signal.
- Save the layout as a chart template so the settings stay the same, and write the symbol and timeframe next to each reading.
Menu names can differ between MT5 builds, so check the path in your own terminal.
What the Alligator cannot tell you
The Alligator is built from smoothed averages, so it reacts after price has already moved. In this guide's own view, which MetaQuotes does not state, the lines can sit well away from price after a fast move. They can also cross during a range without telling you whether the range will last. Read the MetaQuotes narrative as a description of the lines, not a forecast of the next move.
The periods are inputs. The 13, 8 and 5 set is one choice among many, and changing any period changes every reading on the chart. A rule that works on one set of periods may not work on another, so test the exact values you use.
The Gator Oscillator and Fractals do not remove these limits. The oscillator is the distance between the same lines, and Fractals depend on bars that have already formed. A fractal can look clear on a finished chart and still be unclear on the bar where it formed.
To test a rule built on the Alligator, write it down before you look at past charts, including the timeframe, the line order you require and the invalidation point. Then run it forward on a demo account. The paper trading guide explains what a practice record can and cannot show. The evaluation guide sets out a method you can apply to any indicator-based rule.
Risk warning. You can lose more than you deposit, depending on your broker and country. Leverage makes a wrong reading of the lines cost as much as a right reading earns, so size each position before you use any indicator to enter. The leverage and margin guide explains how margin works. Check the rules that apply to you with your own regulator.
For daily charts, the swing trading guide describes the multi-day holding period this guide assumes when it mentions daily bars. The chart types guide covers the candle and bar views the lines are drawn over.
Key takeaways
- The Alligator is three smoothed moving averages of median price, with periods of 13, 8 and 5 and forward shifts of 8, 5 and 3 bars.
- MetaQuotes lists the Alligator, Fractals and Gator Oscillator in its Bill Williams' Indicators group.
- The Gator Oscillator measures the gaps between the same lines, so it shares their lag.
- MetaQuotes says fractal signals need to be filtered with the Alligator, and it gives that rule in terms of the Teeth line.
- Write down the periods, timeframe and reading rule, then test them forward before you risk money.
Frequently asked questions
Is the Alligator indicator built into MT5?
The MetaQuotes help page for Bill Williams' indicators names the Alligator among the indicators available in the trading platform. This guide checks only that help page and the MQL5 documentation, not every MT5 build or broker version.
What are the default Alligator settings?
The MQL5 documentation example sets the jaw to 13 with shift 8, the teeth to 8 with shift 5, and the lips to 5 with shift 3, on SMMA and median price. MetaQuotes does not call these defaults, so confirm the values in your terminal.
Does the Alligator predict where price will go?
No. The lines describe the current order and spacing of smoothed averages. Any reading of direction is a rule you choose, and it can be wrong.
Can you use Fractals together with the Alligator?
Yes. The MetaQuotes Fractals page says fractal signals need to be filtered with the Alligator, and it gives that rule in terms of the Alligator's Teeth. Treat that as the source's description, and test any rule you build on it.
What timeframe should you use with the Alligator?
MetaQuotes does not recommend one. It describes the jaw as the balance line for the timeframe of the chart, and the teeth and lips as balance lines for the timeframes one and two levels lower. Pick the chart timeframe that matches your holding period, state it with every reading, and test the rule on that timeframe alone.
Sources and verification
Primary-source links used for the platform behavior and risk statements in this guide. Sources reviewed 10 November 2026.
- MetaQuotes: Bill Williams' Indicators · Reviewed
- MetaQuotes: Alligator · Reviewed
- MetaQuotes: Fractals · Reviewed
- MetaQuotes: Gator Oscillator · Reviewed
- MetaQuotes: iAlligator · Reviewed