OPEN-SOURCE SCRIPT
Leviathan Protocol - Institutional Liquidity & Sweep Sniper

Description:
The Leviathan Protocol is a comprehensive technical analysis tool designed to track institutional liquidity pools, momentum exhaustion (RSI Divergences), and Support/Resistance Flips (Retests).
Most retail traders fall victim to fakeouts by trading raw breakouts. This indicator was built to filter out market noise and identify the precise moments when "Smart Money" captures liquidity to reverse the market.
HOW THE MATH & LOGIC WORKS:
1. Liquidity Zones (Pivots): The script calculates ta.pivothigh and ta.pivotlow based on a 29-period swing to identify major pools of stop-losses. It plots these as dotted Red (Resistance) and Green (Support) lines.
2. Liquidity Sweeps & Divergence: When the price pierces a liquidity line but closes back inside (leaving a wick), it triggers a Sweep. The script then cross-references this action with a 14-period RSI. If a Top Sweep occurs alongside a lower RSI high, it plots a BEAR DIV label. If a Bottom Sweep occurs with a higher RSI low, it plots a BULL DIV label.
3. S/R Flip Retest (Sniper Mode): When a major liquidity line is completely broken by a candle close, the script saves this level in memory using var variables. If the price returns to test this broken support (now resistance) and gets rejected, it plots an Orange Cross (RETEST SHORT). Vice versa for Longs (RETEST LONG).
4. Predictive EMA 200: Plots a 200 EMA and calculates its angular inertia over the last 5 bars to project a dashed line 30 candles into the future, helping to estimate dynamic support/resistance collisions.
FEATURES & SETTINGS:
* Toggle "Ignore GAP Signals" to prevent false divergence readings in traditional markets (Stocks/Forex) where overnight gaps occur.
Disclaimer: This indicator is for educational and analytical purposes only. It does not constitute financial advice. Always combine these signals with Order Flow analysis (e.g., Spot CVD) and proper risk management.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
🔱 LeviatanSignals® — automação de fluxo institucional (SMC) para Binance e MEXC Futures. Vídeos, app e mais: leviatansignals.com.br/
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.
סקריפט קוד פתוח
ברוח האמיתית של TradingView, יוצר הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יוכלו לעיין בו ולאמת את פעולתו. כל הכבוד למחבר! אמנם ניתן להשתמש בו בחינם, אך זכור כי פרסום חוזר של הקוד כפוף ל־כללי הבית שלנו.
🔱 LeviatanSignals® — automação de fluxo institucional (SMC) para Binance e MEXC Futures. Vídeos, app e mais: leviatansignals.com.br/
כתב ויתור
המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.