Bill Williams TrendCrossoverRegime Có trong Builder

Alligator

The Alligator is three smoothed moving averages of median price, each shifted forward by a different amount, drawn as a jaw, teeth and lips. Its whole purpose is to make the difference between a trending market and a sleeping one visible at a glance.

Periods
13 / 8 / 5
Shifts
8 / 5 / 3
Method
Smoothed (SMMA)
OverboughtOversoldCentreline 50Divergence

Minh họa — dữ liệu tổng hợp, không phải giá thực.

What the Alligator tells you

Three averages of different speeds, each pushed forward by a different amount, spend most of their time tangled together. That tangle is the point: Bill Williams' framing is that the market sleeps most of the time, and the only tradeable state is when the three lines separate and fan out in order.

  • Lines entwined: the market is sleeping — stand aside
  • Lines fanned out in order: a trend is running
  • Lips crossing back through teeth: the move is losing its grip
  1. 1 Smooth median price over 13, 8 and 5 bars
  2. 2 Shift each result forward by 8, 5 and 3
  3. 3 Read whether the three lines are apart or entwined
Hiển thị công thức & chi tiết tính toán

The Alligator is three smoothed moving averages of median price, each displaced forward by a different number of bars:

  1. Jaw (buffer 0) — a 13-period smoothed moving average of median price, (High + Low) / 2, shifted 8 bars forward.
  2. Teeth (buffer 1) — an 8-period smoothed average of the same series, shifted 5 bars forward.
  3. Lips (buffer 2) — a 5-period smoothed average, shifted 3 bars forward.

The smoothed moving average (SMMA) is the slowest of MT5’s four methods — each new bar nudges a running value rather than dropping an old one out of a window — which is what keeps the three lines calm enough to entwine convincingly during a range. The staggered forward shifts are what turn three ordinary averages into a fan: without them the lines would simply track each other with different lags, and the visual distinction between sleeping and awake would be much weaker.

In MQL5 the call is iAlligator(symbol, period, jaw_period, jaw_shift, teeth_period, teeth_shift, lips_period, lips_shift, ma_method, applied_price) and it returns a handle to three buffers. Both ma_method and applied_price are real arguments; the SMMA-on-median configuration is the conventional default, not a fixed property. Bill Williams introduced the Alligator in the 1990s alongside Fractals and the Awesome Oscillator.

Tín hiệu

Các tín hiệu có thể backtest của Alligator — và điều kiện thị trường phù hợp với từng tín hiệu.

Lips / Teeth Crossover

Sẵn sàng trong Builder
Điều kiện
The fast line crosses the middle line
Điều kiện tốt nhất
Trend start
Sử dụng thông thường
Time an entry as the fan begins to open

Price vs Lips

Sẵn sàng trong Builder
Điều kiện
Price closes above or below the fastest line
Điều kiện tốt nhất
Trend continuation
Sử dụng thông thường
Simple directional filter for another rule

Awakening

Logic nâng cao
Điều kiện
All three lines separate and order themselves by period
Điều kiện tốt nhất
Trend start
Sử dụng thông thường
Confirm a real move rather than a single crossover

Sleeping

Logic nâng cao
Điều kiện
The three lines entwine and flatten
Điều kiện tốt nhất
Range
Sử dụng thông thường
Suppress trend entries entirely

Triển khai trong MT5

Những gì MetaTrader 5 thực sự tính và vẽ — cơ sở tham chiếu cho mọi quy tắc trên trang này.

Bộ đệm

Chỉ số Bộ đệm MT5 vẽ dưới dạng Chứa gì
0 GATORJAW_LINE Line (blue) Jaw — a 13-period smoothed average of median price, shifted 8 bars forward. The slowest line.
1 GATORTEETH_LINE Line (red) Teeth — 8-period smoothed average, shifted 5 bars forward.
2 GATORLIPS_LINE Line (green) Lips — 5-period smoothed average, shifted 3 bars forward. The fastest line.

Ghi chú nền tảng

Hoạt động tốt nhất / sử dụng cẩn thận

Không có chỉ báo nào có lợi thế toàn diện. Đây là nơi Alligator hỗ trợ — và nơi nó gây hiểu lầm.

Hoạt động tốt nhất

  • Trending markets
  • Deciding when NOT to trade
  • Higher timeframes
  • As a regime overlay on price

Sử dụng cẩn thận

  • Tight, directionless ranges
  • Crossovers while the lines are entwined
  • Low timeframes
  • Changing the classic periods without validation

Xây dựng chiến lược Alligator

Kết nối tín hiệu vào quy tắc vào lệnh và thoát lệnh, sau đó xuất EA MT5 có thể biên dịch — không cần code.

  1. Lips (5, shift 3)
  2. Teeth (8, shift 5)
  3. Lips crosses above teeth → Open Buy · SL 50 / TP 100
  4. Lips crosses below teeth → Open Sell

Kết hợp Alligator với các chỉ báo khác

Một chỉ báo hiếm khi đứng một mình. Các cặp kết hợp này bù đắp điểm mù của Alligator.

Alligator + Awesome Oscillator

  1. Lips crosses teeth
  2. AO crosses zero
  3. Buy
Lý do
Pair Bill Williams' regime tool with his momentum tool, so a fan that is opening is confirmed by momentum crossing zero
Điều kiện tốt nhất
Trend start

No single-flow template pairs the Alligator with the Awesome Oscillator. Start from Alligator Cross and add an AO node with a Constant zero into a Cross node.

Mở Builder →

Alligator + ADX

  1. ADX > 25
  2. Lips crosses teeth
  3. Buy
Lý do
Replace the visual 'is it sleeping' judgement with a measured trend-strength threshold, which an EA can evaluate without ambiguity
Điều kiện tốt nhất
Trending

No single-flow template pairs the Alligator with ADX. Start from Alligator Cross and add an ADX node with a Compare at 25 into an And gate.

Mở Builder →

Alligator + Fractals

  1. Lines fanned up
  2. Price breaks the last fractal high
  3. Buy
Lý do
Use the fan for direction and the last swing level for the trigger, which is closer to how Bill Williams intended the tools to be used together
Điều kiện tốt nhất
Breakout

No single-flow template pairs the Alligator with Fractals. Start from Alligator Cross and add Fractals nodes with a Price node into a Cross.

Mở Builder →

Alligator + Gator Oscillator

  1. Both Gator halves growing
  2. Lips above Jaw
  3. Buy
Lý do
The same three averages read as distances instead of curves. Judging by eye whether the lines are converging is the hard part of using the Alligator, and the Gator turns it into two numbers that either grew or did not — so the fan supplies direction and the histograms supply the phase. Not an independent confirmation: every Gator value is computed from these three lines
Điều kiện tốt nhất
Trending
Xây dựng chiến lược này →

Tham số

Giá trị ban đầu để xác nhận trên cặp tiền và khung thời gian của bạn — không phải cài đặt được đảm bảo.

Tham số Mặc định Khoảng thử nghiệm đề xuất Chức năng
Jaw period / shift 13 / 8 8–21 / 5–13 The slowest line and its forward displacement. Widening it makes the fan slower to open and slower to close.
Teeth period / shift 8 / 5 5–13 / 3–8 The middle line. Most crossover rules use this as one side of the comparison.
Lips period / shift 5 / 3 3–8 / 2–5 The fastest line. Shortening it produces more crossovers, most of them inside the tangle.
Applied price Median Median / Close / Open / High / Low / Typical / Weighted Price series the three averages run on. Median — (high + low) / 2 — is Bill Williams' original choice and MT5's convention here, not Close.

Cài đặt sẵn ban đầu

Classic 13 / 8 / 5 Bill Williams' original
Faster 8 / 5 / 3 Opens sooner, more false starts
Slower 21 / 13 / 8 Swing-level regime only

Ví dụ thị trường

Nơi Alligator hoạt động, nơi nó thất bại, và bộ lọc thay đổi kết quả như thế nào.

Thành công

The fan opens

After a flat stretch the three lines separate in period order and price runs — the awakening the indicator is built to make visible.

Thất bại

Crossover inside the tangle

Lips and teeth cross back and forth while all three lines sit on top of each other. Each cross is a trade in a market the indicator itself is calling asleep.

Đã lọc

Regime filter suppresses the noise

Add a trend-strength condition and the entwined-period crossovers are all skipped, leaving the ones where the fan is genuinely opening.

FAQ

What does it mean when the Alligator is sleeping?
That the three lines are entwined and flat — the fast, medium and slow averages all agree, which happens when price has no direction. Bill Williams' framing is that this is the market's normal state and that trend rules should simply not fire in it. Expressing 'entwined' precisely enough for an EA is the hard part, which is why a measured filter such as ADX is often used as a stand-in.
Why is the Alligator built on median price?
Because Bill Williams designed it to track the midpoint of the bar rather than its settlement, which makes the lines slightly steadier on instruments with long wicks. iAlligator takes a full ENUM_APPLIED_PRICE argument, so Close and the rest are available — Median is simply the conventional default in MT5.
Do the forward shifts matter for an EA?
Yes. Each line is displaced forward by its own amount inside the indicator, so buffer values do not line up with the current bar the way a plain moving average does. Comparing price directly to a shifted line compares two different points in time. Read the buffer at the offset that corresponds to the bar you mean.
Alligator or moving averages — is there a difference?
Structurally the Alligator is three smoothed averages, so yes, it is a moving-average system. What it adds is the specific configuration — median price, SMMA, and three different forward shifts — plus a framing that treats the entwined state as an instruction to stand aside rather than a state to trade through.
Can I build an Alligator EA without coding?
Yes for crossovers and price-versus-line rules. The Alligator Cross template wires lips and teeth into a Cross node with all periods, shifts, method and applied price as EA inputs. Detecting the fanned-out or entwined state is the exception — that is a three-way ordering test the node palette does not express.
How should I validate settings before going live?
Backtest on quality tick data first, then run the EA on a demo account before risking money. When optimising, hold back data the search never saw and prefer settings that stay profitable across periods over the single in-sample peak — chasing that peak is overfitting the noise. No default or preset here is a performance promise; every value is a starting point to re-validate on your own pair and broker.

Glossary

Thuật ngữ chính