OPEN-SOURCE SCRIPT
Williams Alligator Spread Oscillator (WASO)

Short description (About box)
Williams Alligator Spread Oscillator (WASO) converts Bill Williams’ Alligator into a 0–100 oscillator that measures the average distance between Lips/Teeth/Jaw relative to ATR. High = expansion/trend (default), low = compression/range — making sideways markets easier to spot. Includes adaptive normalization, configurable thresholds, background shading, and alerts.
Full description (Description field)
What it does
The Williams Alligator Spread Oscillator (WASO) transforms Bill Williams’ Alligator into a single, adaptive 0–100 scale. It computes the average pairwise distance among the Alligator lines (Lips/Teeth/Jaw), normalizes it by ATR and a rolling min–max window, and smooths the result. This makes the signal robust across symbols and timeframes and explicitly improves detection of sideways (ranging) conditions by highlighting compression regimes.
Why it helps
Sideways detection made easier: Low WASO marks compressed regimes that commonly align with consolidation/range phases, helping you identify chop and plan breakout strategies.
Trend/expansion clarity: High WASO indicates the Alligator lines are widening relative to volatility, pointing to trending or expanding conditions.
You can flip the direction if you prefer “High = Range.”
How it is calculated (plain English)
Smooth price with RMA (SMMA-like) to get Jaw, Teeth, Lips.
Compute the average pairwise distance between these three lines.
Divide by ATR to remove price-scale effects.
Normalize with a rolling min–max window to map values to 0–100.
Optionally apply EMA smoothing to the oscillator.
Key settings
Jaw/Teeth/Lips Lengths: Alligator periods (SMMA-like via ta.rma).
ATR Length: Volatility benchmark for scaling.
Normalization Lookback: Longer = steadier; shorter = more responsive.
Smoothing (EMA): Evens out noise.
High Value = Large Spread (Trend): Toggle to invert semantics.
Upper/Lower Thresholds: 70/30 are practical starting points.
Signals / interpretation
Sideways / Compression (easier to spot):
Default direction: WASO below Lower Threshold (e.g., <30).
With inverted direction OFF: WASO above Upper Threshold (e.g., >70).
Trend / Expansion:
Default direction: WASO above Upper Threshold (e.g., >70).
With inverted direction OFF: WASO below Lower Threshold (e.g., <30).
Midline (50): Neutral zone; flips around 50 can hint at regime shifts.
Alerts included
Range Start (sideways/compression)
Trend Start (expansion/trend)
Notes & limitations
This implementation omits the classic forward shift of Alligator lines to keep signals usable on live bars.
If market behavior shifts (very quiet or very volatile), tune Lookback and ATR Length.
Combine WASO with breakout levels or momentum filters for entries/exits.
Credits & disclaimer
Inspired by Bill Williams’ Alligator.
For educational purposes only. Not financial advice.
Release Notes (v1.0):
Initial release of Williams-Alligator Spread Oscillator (WASO) with ATR-based scaling and adaptive 0–100 normalization.
Direction toggle (High = Trend by default), adjustable thresholds, background shading, and two alert conditions.
Williams Alligator Spread Oscillator (WASO) converts Bill Williams’ Alligator into a 0–100 oscillator that measures the average distance between Lips/Teeth/Jaw relative to ATR. High = expansion/trend (default), low = compression/range — making sideways markets easier to spot. Includes adaptive normalization, configurable thresholds, background shading, and alerts.
Full description (Description field)
What it does
The Williams Alligator Spread Oscillator (WASO) transforms Bill Williams’ Alligator into a single, adaptive 0–100 scale. It computes the average pairwise distance among the Alligator lines (Lips/Teeth/Jaw), normalizes it by ATR and a rolling min–max window, and smooths the result. This makes the signal robust across symbols and timeframes and explicitly improves detection of sideways (ranging) conditions by highlighting compression regimes.
Why it helps
Sideways detection made easier: Low WASO marks compressed regimes that commonly align with consolidation/range phases, helping you identify chop and plan breakout strategies.
Trend/expansion clarity: High WASO indicates the Alligator lines are widening relative to volatility, pointing to trending or expanding conditions.
You can flip the direction if you prefer “High = Range.”
How it is calculated (plain English)
Smooth price with RMA (SMMA-like) to get Jaw, Teeth, Lips.
Compute the average pairwise distance between these three lines.
Divide by ATR to remove price-scale effects.
Normalize with a rolling min–max window to map values to 0–100.
Optionally apply EMA smoothing to the oscillator.
Key settings
Jaw/Teeth/Lips Lengths: Alligator periods (SMMA-like via ta.rma).
ATR Length: Volatility benchmark for scaling.
Normalization Lookback: Longer = steadier; shorter = more responsive.
Smoothing (EMA): Evens out noise.
High Value = Large Spread (Trend): Toggle to invert semantics.
Upper/Lower Thresholds: 70/30 are practical starting points.
Signals / interpretation
Sideways / Compression (easier to spot):
Default direction: WASO below Lower Threshold (e.g., <30).
With inverted direction OFF: WASO above Upper Threshold (e.g., >70).
Trend / Expansion:
Default direction: WASO above Upper Threshold (e.g., >70).
With inverted direction OFF: WASO below Lower Threshold (e.g., <30).
Midline (50): Neutral zone; flips around 50 can hint at regime shifts.
Alerts included
Range Start (sideways/compression)
Trend Start (expansion/trend)
Notes & limitations
This implementation omits the classic forward shift of Alligator lines to keep signals usable on live bars.
If market behavior shifts (very quiet or very volatile), tune Lookback and ATR Length.
Combine WASO with breakout levels or momentum filters for entries/exits.
Credits & disclaimer
Inspired by Bill Williams’ Alligator.
For educational purposes only. Not financial advice.
Release Notes (v1.0):
Initial release of Williams-Alligator Spread Oscillator (WASO) with ATR-based scaling and adaptive 0–100 normalization.
Direction toggle (High = Trend by default), adjustable thresholds, background shading, and two alert conditions.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.