OPEN-SOURCE SCRIPT
Amihud Illiquidity Surge [forexobroker]

Amihud Illiquidity Surge computes the canonical Amihud (2002) illiquidity ratio: |return| / volume. High value = price moves a lot per unit of volume traded = illiquid market = price-impact dominated regime. Z-scored over a rolling window to detect surges. Signals fire on EMA cross during a surge, gold-and-red palette unique to this indicator.
🔶 ALGORITHM
1. AIS = |close - close[1]| / max(volume, 1).
2. AIS-Z = (AIS - sma(AIS, N)) / stdev(AIS, N).
3. Surge regime when AIS-Z >= threshold.
4. EMA cross within surge fires entries in the prevailing direction.
🔶 SIGNAL LOGIC
- Buy: surge AND close crosses EMA up AND not already long AND cooldown elapsed AND barstate.isconfirmed.
- Sell: surge AND close crosses EMA down.
- Position-lock state machine.
🔶 INPUTS
- Z-Score Window (default 50)
- Surge Z Threshold (default 1.5)
- Pullback EMA Length (default 8)
- Cooldown Bars (default 4)
- Visual: dashboard (gold-themed double border), glow, dollar-symbol labels, buy / sell colors
🔶 ALERTS
AIS Buy, AIS Sell, AIS Any Signal, AIS Surge Start, AIS Surge End, AIS Extreme, AIS EMA Up, AIS EMA Down, AIS Webhook JSON.
🔶 LIMITATIONS
- Forex tick volume is broker-aggregated and noisy; futures, equities, and crypto produce cleaner illiquidity readings.
- The labels show "AIS$" — the dollar symbol is a visual cue, not a units claim.
- For very-low-volume bars (e.g., overnight or holiday sessions) the ratio inflates artificially; the volume floor of 1 mitigates but does not eliminate this.
- AIS surges precede price moves only loosely; pair with a directional gate.
🔶 ALGORITHM
1. AIS = |close - close[1]| / max(volume, 1).
2. AIS-Z = (AIS - sma(AIS, N)) / stdev(AIS, N).
3. Surge regime when AIS-Z >= threshold.
4. EMA cross within surge fires entries in the prevailing direction.
🔶 SIGNAL LOGIC
- Buy: surge AND close crosses EMA up AND not already long AND cooldown elapsed AND barstate.isconfirmed.
- Sell: surge AND close crosses EMA down.
- Position-lock state machine.
🔶 INPUTS
- Z-Score Window (default 50)
- Surge Z Threshold (default 1.5)
- Pullback EMA Length (default 8)
- Cooldown Bars (default 4)
- Visual: dashboard (gold-themed double border), glow, dollar-symbol labels, buy / sell colors
🔶 ALERTS
AIS Buy, AIS Sell, AIS Any Signal, AIS Surge Start, AIS Surge End, AIS Extreme, AIS EMA Up, AIS EMA Down, AIS Webhook JSON.
🔶 LIMITATIONS
- Forex tick volume is broker-aggregated and noisy; futures, equities, and crypto produce cleaner illiquidity readings.
- The labels show "AIS$" — the dollar symbol is a visual cue, not a units claim.
- For very-low-volume bars (e.g., overnight or holiday sessions) the ratio inflates artificially; the volume floor of 1 mitigates but does not eliminate this.
- AIS surges precede price moves only loosely; pair with a directional gate.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
🔵Gain access to our powerful tools : forexobroker.com/tv
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
🔵Gain access to our powerful tools : forexobroker.com/tv
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.