// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // © LiquidityEdgeFutures (https://liquidityedgefutures.com) // ========================================================================================================= // LIQUIDITY EDGE | INSTITUTIONAL VOLUME DISPLACEMENT & DELTA FILTER [FREE COMMUNITY EDITION] // Institutional Momentum & Displacement Validator for CME NQ1!, MNQ1!, ES1! // // Features: // - Identifies true Institutional Displacement Candles (Volume > 1.5x 20-MA & Body > 65% of Range) // - Filters out retail low-volume chop and fakeouts // - Highlights A+ Imbalances engineered by real institutional market makers // - Real-time Volume Delta bar coloring // - Alerts for aggressive institutional buying and selling displacement // ========================================================================================================= //@version=5 indicator("Liquidity Edge - Volume Displacement & Delta Filter", shorttitle="LE - Volume Displacement", overlay=true) // --------------------------------------------------------------------------------------------------------- // INPUT SETTINGS // --------------------------------------------------------------------------------------------------------- var string G_FILTER = "1. Institutional Displacement Thresholds" var string G_VISUAL = "2. Visual Customization" float i_volMultiplier = input.float(1.5, "Volume Multiplier vs 20-Bar SMA", minval=1.1, maxval=3.0, step=0.1, group=G_FILTER) float i_bodyRatioThresh = input.float(0.65, "Min Candle Body to Range Ratio", minval=0.5, maxval=0.9, step=0.05, tooltip="65% body means minimal wicks (pure directional displacement).", group=G_FILTER) bool i_colorBars = input.bool(true, "Color Displacement Candles On Chart", group=G_VISUAL) color i_c_bull_disp = input.color(#38BDF8, "Bullish Displacement Color", group=G_VISUAL) color i_c_bear_disp = input.color(#F59E0B, "Bearish Displacement Color", group=G_VISUAL) // --------------------------------------------------------------------------------------------------------- // DISPLACEMENT ENGINE // --------------------------------------------------------------------------------------------------------- float volSMA = ta.sma(volume, 20) bool isHighVolume = volume >= (volSMA * i_volMultiplier) float candleRange = high - low float candleBody = math.abs(close - open) bool isFullBody = (candleRange > 0) and ((candleBody / candleRange) >= i_bodyRatioThresh) bool isBullishCandle = close > open bool isBearishCandle = close < open // Institutional Displacement Signal bool isBullDisplacement = isHighVolume and isFullBody and isBullishCandle bool isBearDisplacement = isHighVolume and isFullBody and isBearishCandle // On-chart candle color override barcolor(i_colorBars ? (isBullDisplacement ? i_c_bull_disp : (isBearDisplacement ? i_c_bear_disp : na)) : na) plotshape(isBullDisplacement, "Institutional Bullish Displacement", shape.labelup, location.belowbar, color=i_c_bull_disp, text="ALGO BUY", textcolor=#020617, size=size.tiny) plotshape(isBearDisplacement, "Institutional Bearish Displacement", shape.labeldown, location.abovebar, color=i_c_bear_disp, text="ALGO SELL", textcolor=#020617, size=size.tiny) // --------------------------------------------------------------------------------------------------------- // ON-CHART HUD STATUS // --------------------------------------------------------------------------------------------------------- var table dispHud = table.new(position.bottom_left, 2, 4, bgcolor=color.new(#030712, 10), border_color=color.new(#1E2D48, 30), border_width=1) if barstate.islast table.cell(dispHud, 0, 0, "LIQUIDITY EDGE", text_color=#38BDF8, text_size=size.tiny, text_font_family=font.family_monospace, bgcolor=#0A0F1D) table.cell(dispHud, 1, 0, "VOLUME DISPLACEMENT", text_color=#F8FAFC, text_size=size.tiny, text_font_family=font.family_monospace, bgcolor=#0A0F1D) // Current bar volume ratio float vRatio = volSMA > 0 ? (volume / volSMA) : 1.0 string vText = str.tostring(vRatio, "#.##") + "x (Avg: " + str.tostring(volSMA, "#") + ")" color vCol = vRatio >= i_volMultiplier ? #38BDF8 : #94A3B8 table.cell(dispHud, 0, 1, "Volume Pace", text_color=#94A3B8, text_size=size.tiny, text_font_family=font.family_monospace) table.cell(dispHud, 1, 1, vText, text_color=vCol, text_size=size.tiny, text_font_family=font.family_monospace) // Last Displacement State string dState = isBullDisplacement ? "BULLISH EXPANSION" : (isBearDisplacement ? "BEARISH EXPANSION" : "STANDARD FLOW") color dCol = isBullDisplacement ? #38BDF8 : (isBearDisplacement ? #F59E0B : #64748B) table.cell(dispHud, 0, 2, "Displacement State", text_color=#94A3B8, text_size=size.tiny, text_font_family=font.family_monospace) table.cell(dispHud, 1, 2, dState, text_color=dCol, text_size=size.tiny, text_font_family=font.family_monospace) // A+ Setup Quality Check string qual = (isBullDisplacement or isBearDisplacement) ? "A+ SETUP CANDIDATE" : "WAITING FOR DISPLACEMENT" color qualCol = (isBullDisplacement or isBearDisplacement) ? #10B981 : #94A3B8 table.cell(dispHud, 0, 3, "Setup Grade", text_color=#94A3B8, text_size=size.tiny, text_font_family=font.family_monospace) table.cell(dispHud, 1, 3, qual, text_color=qualCol, text_size=size.tiny, text_font_family=font.family_monospace) // --------------------------------------------------------------------------------------------------------- // ALERTS // --------------------------------------------------------------------------------------------------------- alertcondition(isBullDisplacement, title="Institutional Bullish Displacement", message="[Liquidity Edge] 🚀 High-Volume Bullish Displacement on {{ticker}}! Volume: {{volume}}") alertcondition(isBearDisplacement, title="Institutional Bearish Displacement", message="[Liquidity Edge] 🩸 High-Volume Bearish Displacement on {{ticker}}! Volume: {{volume}}")