OPEN-SOURCE SCRIPT

Amihud Illiquidity Surge [forexobroker]

513
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.

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.