OPEN-SOURCE SCRIPT
CRR Bill Williams

These are SMMA based on the average price (high+low/2):
Jaw – Blue
Slow line, the base of the trend.
Teeth – Red
Medium speed.
Lips – Green/Lime
The fast one, the one that touches the price first.
Trend reading with the Alligator:
🟢 Uptrend (trendUpAlligator):
Lips (green) > Teeth (red) > Jaw (blue)
The alligator is awake and eating UP.
🔴 Downtrend (trendDownAlligator):
Lips (green) < Teeth (red) < Jaw (blue)
The alligator is eating DOWN.
⚪ Range / sleeping market (trendNeutral):
The lines cross, get tangled, without a clear order → better NOT to trade aggressively there.
In the HUD it shows it as:
UPTREND (green)
DOWNTREND (red)
RANGE (gray)
2️⃣ Fractals (▲ and ▼ arrows)
Fractal High (▲ green): possible local top (resistance).
Fractal Low (▼ red): possible local bottom (support).
They serve as:
Points where the price can break through to continue.
Areas where you can place stop losses or breakouts.
3️⃣ AO and AC (trend strength)
AO (Awesome Oscillator): difference of moving averages (5 and 34 of the average price).
AO > 0 → bullish pressure.
AO < 0 → bearish pressure.
AC (Accelerator): AO – average of AO.
AC > 0 → acceleration in favor of the movement.
AC < 0 → the movement slows down or goes against the trend.
In the HUD you see:
AO > 0 | AC > 0 → good tailwind.
AO < 0 | AC < 0 → strong headwind. 4️⃣ Bill Williams MFI (GREEN, FADE, FAKE, SQUAT)
This MFI is based on the candle range/volume and then compares it to the previous candle:
GREEN (Lime) → mfiUp + volUp
Price and volume rise together → real, strong momentum.
FADE (Gray) → mfiDown + volDown
Everything is dying down, price and volume fall → exhaustion.
FAKE (Orange) → mfiUp + volDown
Price rises but volume falls → deceptive movement.
SQUAT (Fuchsia) → mfiDown + volUp
Strong fight between buyers and sellers → explosive zone.
The color you see in the "MFI" HUD is:
Green → healthy momentum
Gray → fading out
Orange → deception
Fuchsia → strong fight, a big move may be coming
5️⃣ Candle Colors (barcolor)
Your script paints the candles like this:
💚 StrongBull (strong buying)
Bullish Alligator (Lips > Teeth > Jaw)
AO > 0
AC > 0
MFI = "GREEN"
→ Bright LIME candle:
👉 strong upward trend, ideal time to look for buying opportunities.
❤️ StrongBear (strong selling)
Bearish Alligator (Lips < Teeth < Jaw)
AO < 0
AC < 0
MFI = "GREEN"
→ Strong RED candle:
👉 strong downward trend, ideal for looking for selling opportunities.
🩵 Normal bullish trend:
Bullish Alligator but without all the strength conditions → TEAL (bluish-green) candle.
🟥 Normal bearish trend:
Bearish Alligator but without full strength → MAROON candle.
⚪ Sideways market:
Everything mixed → translucent GRAY candle (color.gray 60).
👉 Not the best time to enter aggressively. 6️⃣ BUY / SELL Signals (triangles)
✔️ BUY Condition (longSignalCond)
The code requires:
Bullish Alligator → Lips > Teeth > Jaw
AO > 0
AC > 0
MFI = GREEN or SQUAT
close > Lips (green lips) → the price is already above the fast moving average.
When fulfilled:
A green “BUY” triangle appears below the candle.
In the HUD:
Trend: BULLISH (green)
AO / AC: > 0
MFI: GREEN or SQUAT
BW Setup: “SIGNAL: BUY”
Context: “Buying Pressure”
👉 Idea for making money (buys):
Wait for the Alligator to be in a bullish order.
Check that the HUD says BULLISH and AO/AC > 0.
Check MFI: GREEN or SQUAT.
As soon as the BUY triangle appears and the candle is lime/teal, you can:
Enter a buy position.
Place the stop loss below the last fractal low (▼).
Close partially when:
MFI changes to FADE/FAKE or
The candles change to gray/maroon or
The Alligator becomes entangled (loses its order).
❌ SELL Condition (shortSignalCond)
The code requires:
Bearish Alligator → Lips < Teeth < Jaw
AO < 0
AC < 0
MFI = GREEN or SQUAT (strength but downwards)
close < Lips → price below the lips.
When fulfilled:
A red “SELL” triangle appears above the candle.
In the HUD:
Trend: BEARISH
AO / AC: < 0
MFI: GREEN / SQUAT
BW Setup: “SIGNAL: SELL”
Context: “Selling Pressure”
👉 Idea for making money (sells):
Wait for the Alligator to be in a bearish order.
HUD in BEARISH, AO/AC < 0.
MFI in GREEN or SQUAT.
When the SELL triangle appears with a red/maroon candle:
Enter a sell position. Stop above the last fractal high (▲).
Partial exit when:
MFI changes to FADE/FAKE,
The candles turn gray/teal,
Or the Alligator becomes tangled.
7️⃣ When NOT to trade
Avoid:
HUD → “RANGE”
Mostly gray candles.
AO and AC mixed (one >0 and the other <0).
MFI constantly in FAKE/FADE.
In these situations, the system tells you: slow or deceptive market → not suitable for serious trades.
8️⃣ Ultra-short summary (golden rule)
BUY:
Alligator ordered UP (green > red > blue).
AO > 0 and AC > 0.
MFI = GREEN or SQUAT.
Strong green candle (lime/teal) + BUY triangle.
Even better if it breaks a previous fractal low upwards.
SELL:
Alligator ordered DOWN (green < red < blue).
AO < 0 and AC < 0.
MFI = GREEN or SQUAT.
Red/maroon candle + SELL triangle.
Even better if it breaks a fractal high downwards.
Jaw – Blue
Slow line, the base of the trend.
Teeth – Red
Medium speed.
Lips – Green/Lime
The fast one, the one that touches the price first.
Trend reading with the Alligator:
🟢 Uptrend (trendUpAlligator):
Lips (green) > Teeth (red) > Jaw (blue)
The alligator is awake and eating UP.
🔴 Downtrend (trendDownAlligator):
Lips (green) < Teeth (red) < Jaw (blue)
The alligator is eating DOWN.
⚪ Range / sleeping market (trendNeutral):
The lines cross, get tangled, without a clear order → better NOT to trade aggressively there.
In the HUD it shows it as:
UPTREND (green)
DOWNTREND (red)
RANGE (gray)
2️⃣ Fractals (▲ and ▼ arrows)
Fractal High (▲ green): possible local top (resistance).
Fractal Low (▼ red): possible local bottom (support).
They serve as:
Points where the price can break through to continue.
Areas where you can place stop losses or breakouts.
3️⃣ AO and AC (trend strength)
AO (Awesome Oscillator): difference of moving averages (5 and 34 of the average price).
AO > 0 → bullish pressure.
AO < 0 → bearish pressure.
AC (Accelerator): AO – average of AO.
AC > 0 → acceleration in favor of the movement.
AC < 0 → the movement slows down or goes against the trend.
In the HUD you see:
AO > 0 | AC > 0 → good tailwind.
AO < 0 | AC < 0 → strong headwind. 4️⃣ Bill Williams MFI (GREEN, FADE, FAKE, SQUAT)
This MFI is based on the candle range/volume and then compares it to the previous candle:
GREEN (Lime) → mfiUp + volUp
Price and volume rise together → real, strong momentum.
FADE (Gray) → mfiDown + volDown
Everything is dying down, price and volume fall → exhaustion.
FAKE (Orange) → mfiUp + volDown
Price rises but volume falls → deceptive movement.
SQUAT (Fuchsia) → mfiDown + volUp
Strong fight between buyers and sellers → explosive zone.
The color you see in the "MFI" HUD is:
Green → healthy momentum
Gray → fading out
Orange → deception
Fuchsia → strong fight, a big move may be coming
5️⃣ Candle Colors (barcolor)
Your script paints the candles like this:
💚 StrongBull (strong buying)
Bullish Alligator (Lips > Teeth > Jaw)
AO > 0
AC > 0
MFI = "GREEN"
→ Bright LIME candle:
👉 strong upward trend, ideal time to look for buying opportunities.
❤️ StrongBear (strong selling)
Bearish Alligator (Lips < Teeth < Jaw)
AO < 0
AC < 0
MFI = "GREEN"
→ Strong RED candle:
👉 strong downward trend, ideal for looking for selling opportunities.
🩵 Normal bullish trend:
Bullish Alligator but without all the strength conditions → TEAL (bluish-green) candle.
🟥 Normal bearish trend:
Bearish Alligator but without full strength → MAROON candle.
⚪ Sideways market:
Everything mixed → translucent GRAY candle (color.gray 60).
👉 Not the best time to enter aggressively. 6️⃣ BUY / SELL Signals (triangles)
✔️ BUY Condition (longSignalCond)
The code requires:
Bullish Alligator → Lips > Teeth > Jaw
AO > 0
AC > 0
MFI = GREEN or SQUAT
close > Lips (green lips) → the price is already above the fast moving average.
When fulfilled:
A green “BUY” triangle appears below the candle.
In the HUD:
Trend: BULLISH (green)
AO / AC: > 0
MFI: GREEN or SQUAT
BW Setup: “SIGNAL: BUY”
Context: “Buying Pressure”
👉 Idea for making money (buys):
Wait for the Alligator to be in a bullish order.
Check that the HUD says BULLISH and AO/AC > 0.
Check MFI: GREEN or SQUAT.
As soon as the BUY triangle appears and the candle is lime/teal, you can:
Enter a buy position.
Place the stop loss below the last fractal low (▼).
Close partially when:
MFI changes to FADE/FAKE or
The candles change to gray/maroon or
The Alligator becomes entangled (loses its order).
❌ SELL Condition (shortSignalCond)
The code requires:
Bearish Alligator → Lips < Teeth < Jaw
AO < 0
AC < 0
MFI = GREEN or SQUAT (strength but downwards)
close < Lips → price below the lips.
When fulfilled:
A red “SELL” triangle appears above the candle.
In the HUD:
Trend: BEARISH
AO / AC: < 0
MFI: GREEN / SQUAT
BW Setup: “SIGNAL: SELL”
Context: “Selling Pressure”
👉 Idea for making money (sells):
Wait for the Alligator to be in a bearish order.
HUD in BEARISH, AO/AC < 0.
MFI in GREEN or SQUAT.
When the SELL triangle appears with a red/maroon candle:
Enter a sell position. Stop above the last fractal high (▲).
Partial exit when:
MFI changes to FADE/FAKE,
The candles turn gray/teal,
Or the Alligator becomes tangled.
7️⃣ When NOT to trade
Avoid:
HUD → “RANGE”
Mostly gray candles.
AO and AC mixed (one >0 and the other <0).
MFI constantly in FAKE/FADE.
In these situations, the system tells you: slow or deceptive market → not suitable for serious trades.
8️⃣ Ultra-short summary (golden rule)
BUY:
Alligator ordered UP (green > red > blue).
AO > 0 and AC > 0.
MFI = GREEN or SQUAT.
Strong green candle (lime/teal) + BUY triangle.
Even better if it breaks a previous fractal low upwards.
SELL:
Alligator ordered DOWN (green < red < blue).
AO < 0 and AC < 0.
MFI = GREEN or SQUAT.
Red/maroon candle + SELL triangle.
Even better if it breaks a fractal high downwards.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.