Alligator Trend Indicator for MT4 and MT5

Written by Dominic Walsh · Published · Last updated

Bill Williams named the three lines after a sleeping animal, and the whole idea turns on when it wakes. The alligator trend indicator draws Jaw, Teeth and Lips, then marks the exact bar where the three first stack into order rather than every bar the order holds.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H4.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Main price chart
Plots 5: Jaw, Teeth, Lips, Buy, Sell
Alerts popup, push notification, email, sound
Inputs 13

Plot by plot

Three lines plus a pair of marks.

`Jaw` traces blue at width 2.

`Teeth` traces red beside it.

`Lips` traces lime green at the same width.

`Buy` prints lime at width 4 using arrow 233.

`Sell` prints red at width 4 using arrow 234.

  • Jaw: line, blue, width 2
  • Teeth: line, red, width 2
  • Lips: line, lime green, width 2
  • Buy: arrow, lime, width 4, arrow code 233
  • Sell: arrow, red, width 4, arrow code 234
alligator trend indicator: The three lines fanning out with a mark, EURUSD H4.
The three lines fanning out with a mark, EURUSD H4.

How the Alligator trend Indicator calculates its values

Three smoothed averages

`JawPeriod` `13`, `TeethPeriod` `8` and `LipsPeriod` `5` each run a smoothed average over the midpoint between high and low. Smoothed means each new value leans heavily on the previous one.

The displacement settings

`JawShift` `8`, `TeethShift` `5` and `LipsShift` `3` are the forward offsets the method is drawn with. Williams pushed the slower lines further ahead so the braid reads clearly.

Marking the moment

Order is what counts. Lips above Teeth above Jaw on a bar where that was not true before prints the buy mark, and the reverse stack prints the sell.

What you are looking at

Three lines braided together means no trend.

Lines fanning apart means one is developing.

A mark lands only on the first bar of an order.

Continuation prints nothing further.

Smoothed averages turn slowly by construction.

`ArrowOffsetPoints` `40` sets the gap from the candle.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

The three lines first falling into order is what speaks. `EnableAlerts` is the master switch and a popup window already shows it. The mobile terminal, outgoing mail and the sound named by `SoundFile` all start closed, one message per closed bar.

Every Alligator trend Indicator input

Core settings

Setting What it does Default
JawPeriod Slowest of the three windows, `13`. 13
JawShift Forward offset the slowest line carries, `8`. 8
TeethPeriod Middle window, `8`. 8
TeethShift Its forward offset, `5`. 5
LipsPeriod Fastest window, `5`. 5
LipsShift Its forward offset, `3`. 3

Display settings

Setting What it does Default
ArrowOffsetPoints Points between a mark and the bar, `40`. 40

Alert settings

Setting What it does Default
EnableAlerts Master switch over the alignment message, `true`. on
EnablePopup A popup window shows it, `true`. on
EnablePushNotify (see inputs panel) off
EnableEmail (see inputs panel) off
EnableSound (see inputs panel) off
SoundFile Sound used, `”alert.wav”`. alert.wav
alligator trend indicator: Inputs panel, the three periods with their offsets.
Inputs panel, the three periods with their offsets.

Suitable markets

Smoothed averages want room, which is why the reference shot is EURUSD H4 rather than the usual hourly chart. There the three lines braid for days and fan out perhaps twice a month. On M15 they tangle constantly.

Where it disappoints

Smoothed averages lag more than plain ones.

The braid can hold for weeks with no mark.

An order can form and break within two bars.

Three lines at close periods track each other tightly.

Copy the compiled Alligator trend Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Related on forexmt4systems.com: Heikin Ashi Trend Strategy.

Download the Alligator trend Indicator for MT4 and MT5

The zip holds the compiled Alligator trend Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

What order do Jaw, Teeth and Lips need for a Buy?

Lips above Teeth, and Teeth above Jaw, on a bar where that stack did not hold before. The fastest line on top and the slowest at the bottom is what the method treats as an awake market.

Why are JawPeriod 13 and TeethPeriod 8 so close together?

Because the method reads the gaps between three similar lines rather than a wide crossover. Thirteen, eight and five sit close on purpose, which keeps the lines braided tightly whenever there is nothing to trade.

How far ahead does the Jaw line get pushed?

Eight bars, against five for Teeth and three for Lips. Williams displaced the slower lines further so the braid stays readable instead of collapsing into one thick band across the chart.

Why does a Buy mark appear only once per run?

Because the rule tests for the order becoming true, not being true. After the three lines stack, further bars in the same arrangement print nothing, which keeps one mark per move.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Alligator trend Indicator as one input. Always backtest before trading live.

Category: this is part of our Trend collection. Also, browse more Trend for MetaTrader, or explore every MT4 indicator and MT5 indicator on the site.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment