Bill Williams Trend Aligator
- Indicatori
- Kostadin Yankov
- Versione: 1.0
================================================================
BILL WILLIAMS PROFITUNITY GOLD SIGNAL
(Trend with Aligator and fractals ) Written by Kostadin Yankov & AI
Version 1.00 | Optimized for XAUUSD (Gold)
================================================================
----------------------------------------------------------------
ABOUT THE STRATEGY — THEORY
----------------------------------------------------------------
"Profitunity" is a trading system created by the legendary
American trader and psychologist Bill Williams, described in
detail in his books:
- "Trading Chaos" (1995)
- "New Trading Dimensions" (1998)
Williams' philosophy is based on Chaos Theory — markets are
not random, but follow nonlinear dynamics that can be read
through specific tools. He argued that most traders fail not
because of the market, but because of their own psychology
and the wrong analytical tools.
The system uses 5 "dimensions" (Wise Men):
1. Awesome Oscillator (AO)
2. Accelerator Oscillator (AC)
3. Alligator — trend filter
4. Fractals — entry points
5. Balance Line — value zones
This indicator implements the "Second Wise Man" signal —
the most reliable entry in the Williams system, combining
a confirmed fractal with Alligator alignment and AO direction.
----------------------------------------------------------------
HOW THE INDICATOR WORKS
----------------------------------------------------------------
STEP 1 — ALLIGATOR
-------------------
The Alligator consists of three smoothed moving averages:
• Jaw — 13 periods, shift 8 — BLUE line
• Teeth — 8 periods, shift 5 — RED line
• Lips — 5 periods, shift 3 — GREEN line
Interpretation:
EATING UP — Lips > Teeth > Jaw (all ordered upward)
The Alligator is "eating" — strong BULL trend
→ Look for BUY signals only
EATING DN — Lips < Teeth < Jaw (all ordered downward)
The Alligator is "eating" — strong BEAR trend
→ Look for SELL signals only
SLEEPING — Three lines intertwined, small spread
The Alligator is "sleeping" — NO trading
WAKING UP — Spread is widening — prepare for entry
STEP 2 — HTF FILTER (Higher Time Frame)
----------------------------------------
By default the indicator checks the H1 Alligator as well.
If you are trading on M15 — H1 must confirm the direction.
This significantly reduces false signals.
UseHTF = true → H1 confirmation required (recommended)
UseHTF = false → Current timeframe only
STEP 3 — AWESOME OSCILLATOR (AO)
----------------------------------
AO measures momentum — the difference between 5 and 34 period
SMA applied to the midpoint of each bar (High+Low)/2.
AO > 0 and rising → Bull momentum — confirms BUY
AO < 0 and falling → Bear momentum — confirms SELL
RequireAO = true → AO must confirm direction (recommended)
STEP 4 — FRACTAL SIGNAL (Second Wise Man)
------------------------------------------
A fractal is a specific candle formation:
• Fractal UP — candle with higher HIGH than the 2 neighbors
on both sides (5 candles total)
• Fractal DN — candle with lower LOW than the 2 neighbors
BUY SIGNAL conditions:
✓ Alligator in bull alignment (Lips > Teeth > Jaw)
✓ HTF confirmation (H1 bull alignment)
✓ AO is rising
✓ A Fractal DOWN appears
✓ Current price is ABOVE the Teeth line
→ A BLUE arrow ↑ is drawn with label "BUY"
SELL SIGNAL conditions:
✓ Alligator in bear alignment (Lips < Teeth < Jaw)
✓ HTF confirmation (H1 bear alignment)
✓ AO is falling
✓ A Fractal UP appears
✓ Current price is BELOW the Teeth line
→ A RED arrow ↓ is drawn with label "SELL"
STEP 5 — SL/TP LINES
----------------------
With every signal the indicator automatically draws:
SL (Stop Loss) — placed at the previous fractal
in the opposite direction
TP1, TP2, TP3 — calculated as multiples of risk (SL distance):
SCALPER: TP1=0.5x TP2=1.0x TP3=1.5x
NORMAL: TP1=1.0x TP2=2.0x TP3=3.0x ← default
AGGR: TP1=1.5x TP2=3.0x TP3=5.0x
ACTIVE SIGNAL (most recent):
• SL line — RED, thick
• TP1 line — YELLOW
• TP2 line — GOLD
• TP3 line — LIME GREEN
HISTORICAL SIGNALS (past):
• All lines — GRAY (DimGray)
----------------------------------------------------------------
RISK PROFILE SETTINGS
----------------------------------------------------------------
The indicator offers three risk profiles:
┌──────────┬──────┬──────┬──────┬──────────────────────────────┐
│ Profile │ TP1 │ TP2 │ TP3 │ Best suited for │
├──────────┼──────┼──────┼──────┼──────────────────────────────┤
│ SCALPER │ 0.5x │ 1.0x │ 1.5x │ Short-term, quick exits │
│ NORMAL │ 1.0x │ 2.0x │ 3.0x │ Standard Risk/Reward 1:2 │
│ AGGR │ 1.5x │ 3.0x │ 5.0x │ Aggressive, long hold │
└──────────┴──────┴──────┴──────┴──────────────────────────────┘
----------------------------------------------------------------
PUSH NOTIFICATIONS
----------------------------------------------------------------
When a new BUY or SELL signal appears, the indicator sends:
• Push notification to your mobile phone (MetaTrader Mobile)
• Sound Alert in the platform
To receive push notifications:
1. Install MetaTrader 5 on your phone
2. Log in with the same account
3. In MT5 Desktop: Tools → Options → Notifications
→ Check "Enable push notifications"
The notification message looks like this:
"BUY Signal | XAUUSD H1 | Entry: 5034.50 | SL: 4980.68"
"SELL Signal | XAUUSD H1 | Entry: 5180.20 | SL: 5220.00"
The notification is sent only once per signal —
it does not repeat on every tick.
Settings:
SendPushAlert = true/false → Enable/disable mobile push
SendSoundAlert = true/false → Enable/disable sound alert
----------------------------------------------------------------
INDICATOR PANEL
----------------------------------------------------------------
In the upper left corner of the chart an information panel
is displayed showing real-time data. Here is exactly what
you will see:
══════════════════════════════
Bill Williams Profitunity
GOLD Signal
Written by Kostadin Yankov & AI
══════════════════════════════
EATING UP - BUY zone
Dir: BUY Str: ***.. (3/5)
------------------------------
Jaw : 5021.45
Teeth: 5028.90
Lips : 5035.12
AO: BULL rising AC: BULL
══════════════════════════════
RISK PROFILE:
[ ] SCALPER [*] NORMAL [ ] AGGR
Click buttons top-center to change
------------------------------
ACTIVE SIGNAL:
BUY [ OPEN ] @ 5034.50
SL : 4980.68
TP1 : 5088.32 (x1.0R)
TP2 : 5142.14 (x2.0R)
TP3 : 5249.78 (x3.0R)
══════════════════════════════
RISK PROFILE BUTTONS
--------------------
Three clickable buttons are displayed at the TOP CENTER of
the chart:
[ SCALPER ] [ NORMAL ] [ AGGR ]
The active profile is highlighted in color:
SCALPER — blue NORMAL — gold AGGR — red
Click any button to instantly switch the risk profile.
No need to open Settings (F7). No restart required.
The SL/TP lines update immediately on the chart.
Panel field explanations:
Alligator state — one of:
EATING UP - BUY zone → Bull trend, look for BUY only
EATING DN - SELL zone → Bear trend, look for SELL only
SLEEPING - No trade → Market consolidating, stay out
WAKING UP - Prepare → Trend forming, get ready
MIXED - Wait → No clear direction
Dir: BUY / SELL / FLAT
→ Current Alligator direction
Str: ***.. (3/5)
→ Signal strength score out of 5:
* Alligator lines are aligned (bull or bear)
* AO is on the correct side (positive/negative)
* AO is rising (bull) or falling (bear)
* AC is on the correct side
* Alligator spread is widening
AO: BULL rising / BULL falling / BEAR rising / BEAR falling
→ Awesome Oscillator value and momentum direction
AC: BULL / BEAR
→ Accelerator Oscillator side
RISK PROFILE — active profile shown in the info panel:
[ ] SCALPER [*] NORMAL [ ] AGGR
Switch instantly using the buttons at the top center
ACTIVE SIGNAL:
BUY [ OPEN ] or SELL [ OPEN ]
→ The most recent signal. Lines remain colored until
a new signal appears, at which point the old lines
turn gray and the new signal becomes active.
TP values — R means Risk units:
(x1.0R) = target is 1x the SL distance away
(x2.0R) = target is 2x the SL distance away
(x3.0R) = target is 3x the SL distance away
Example: SL = 53 pts → TP1 = 53 pts, TP2 = 106 pts, TP3 = 159 pts
----------------------------------------------------------------
USAGE RECOMMENDATIONS
----------------------------------------------------------------
Timeframe: H1 or M15 for GOLD (XAUUSD)
HTF Filter: Always enabled (UseHTF = true)
AO Filter: Always enabled (RequireAO = true)
Risk: NORMAL for beginners
SCALPER for active intraday trading
AGGR only for experienced traders
DO NOT trade when:
✗ The Alligator is sleeping (SLEEPING state)
✗ Signal strength is below 3/5
✗ Before major news events (NFP, FOMC, CPI, Fed speeches)
✗ During very low liquidity periods (Asian session for Gold)
TRADE only when:
✓ State is EATING UP or EATING DN
✓ Signal strength is 3/5 or higher
✓ HTF confirms the direction
✓ Both AO and AC confirm
✓ Price is clearly above/below the Teeth line
----------------------------------------------------------------
INPUT PARAMETERS
----------------------------------------------------------------
ALLIGATOR:
JawPeriod / JawShift — Jaw MA settings (default 13/8)
TeethPeriod / TeethShift — Teeth MA settings (default 8/5)
LipsPeriod / LipsShift — Lips MA settings (default 5/3)
ClrJaw / ClrTeeth / ClrLips — Line colors
FRACTALS:
ShowFractals — Show/hide fractal arrows
ClrFracUp — Fractal up arrow color
ClrFracDn — Fractal down arrow color
SIGNALS:
ShowSignals — Show/hide BUY/SELL arrows
RequireAO — Require AO confirmation (recommended: true)
ClrBuy — BUY arrow color
ClrSell — SELL arrow color
ArrowSize — Arrow size (1-5)
ArrowOffset — Arrow offset from price in dollars
HTF FILTER:
UseHTF — Enable Higher Time Frame filter
HTF_TF — Which timeframe to use as filter (default H1)
RISK PROFILE:
Switched using the three buttons at the TOP CENTER of the chart:
[ SCALPER ] [ NORMAL ] [ AGGR ]
Click once — lines update instantly. No F7 needed.
NOTIFICATIONS:
SendPushAlert — Push notification to mobile
SendSoundAlert — Sound alert in platform
PANEL:
ShowPanel — Show/hide the info panel (Comment)
----------------------------------------------------------------
TECHNICAL DETAILS
----------------------------------------------------------------
Indicator buffers:
0 — Jaw (Alligator Jaw line)
1 — Teeth (Alligator Teeth line)
2 — Lips (Alligator Lips line)
3 — Fractal Up arrows
4 — Fractal Down arrows
5 — BUY signal arrows
6 — SELL signal arrows
7 — Empty (internal calculations)
Chart objects created:
AGWS_ACT_SL/T1/T2/T3 — Active signal lines (colored)
AGWS_ACT_SL_L/T1_L/... — Active signal labels
AGWS_H_<timestamp>_* — Historical signal lines (gray)
AGWS_B_<timestamp> — BUY text label
AGWS_S_<timestamp> — SELL text label
----------------------------------------------------------------
DISCLAIMER
----------------------------------------------------------------
Written by Kostadin Yankov & AI.
For personal use and educational purposes.
This indicator is NOT financial advice.
Past performance does not guarantee future results.
