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.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
🔵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.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
🔵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.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.