// 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 | SESSION LIQUIDITY SWEEPS & EQUAL HIGHS/LOWS (EQH/EQL) [FREE COMMUNITY EDITION] // Institutional Liquidity Range Tracker & Judas Swing Detector for CME NQ1!, MNQ1!, ES1! // // Features: // - Automated Asia Session (18:00 - 00:00 EST) High & Low tracking // - Automated London Session (02:00 - 05:00 EST) High & Low tracking // - Real-time detection of Liquidity Sweeps (Asia High/Low or London High/Low swept by NY) // - Automatic detection of Equal Highs (EQH) and Equal Lows (EQL) resting stop pools ($$$) // - Institutional alerts for buy-side and sell-side liquidity purges // ========================================================================================================= //@version=5 indicator("Liquidity Edge - Session Liquidity Sweeps & EQH/EQL", shorttitle="LE - Session Sweeps", overlay=true, max_boxes_count=100, max_lines_count=500, max_labels_count=500) // --------------------------------------------------------------------------------------------------------- // INPUTS & CONFIGURATION // --------------------------------------------------------------------------------------------------------- var string G_SESSIONS = "1. Session Ranges (New York Time)" var string G_SWEEPS = "2. Sweep Detection & Alerts" var string G_EQH_EQL = "3. Equal Highs / Lows (EQH/EQL) Radar" // Sessions bool i_showAsia = input.bool(true, "Show Asia Session (18:00 - 00:00 EST)", group=G_SESSIONS) color i_c_asia = input.color(color.new(#818CF8, 92), "Asia Session Box Tint", group=G_SESSIONS) color i_c_asia_line = input.color(color.new(#818CF8, 30), "Asia High / Low Lines", group=G_SESSIONS) bool i_showLondon = input.bool(true, "Show London Session (02:00 - 05:00 EST)", group=G_SESSIONS) color i_c_london = input.color(color.new(#38BDF8, 92), "London Session Box Tint", group=G_SESSIONS) color i_c_lon_line = input.color(color.new(#38BDF8, 30), "London High / Low Lines", group=G_SESSIONS) // EQH / EQL bool i_showEqhEql = input.bool(true, "Identify Equal Highs / Equal Lows ($$$ Pools)", group=G_EQH_EQL) int i_eq_ticks = input.int(4, "Max Ticks Difference for Equal High/Low", minval=1, maxval=12, tooltip="For NQ, 4 ticks = 1 point.", group=G_EQH_EQL) int i_swing_len = input.int(5, "Swing Pivot Lookback Length", minval=2, maxval=15, group=G_EQH_EQL) // --------------------------------------------------------------------------------------------------------- // SESSION TIMING CHECKS (New York Timezone) // --------------------------------------------------------------------------------------------------------- t_asia = not na(time(timeframe.period, "1800-0000:1234567", "America/New_York")) t_london = not na(time(timeframe.period, "0200-0500:23456", "America/New_York")) t_ny = not na(time(timeframe.period, "0930-1600:23456", "America/New_York")) // Background tinting bgcolor(i_showAsia and t_asia ? i_c_asia : na, title="Asia Session Background") bgcolor(i_showLondon and t_london ? i_c_london : na, title="London Session Background") // --------------------------------------------------------------------------------------------------------- // ASIA HIGH & LOW TRACKER // --------------------------------------------------------------------------------------------------------- var float asia_high = na var float asia_low = na var line ln_asia_h = na var line ln_asia_l = na var bool asia_h_swept = false var bool asia_l_swept = false if t_asia and not t_asia[1] // New Asia session started asia_high := high asia_low := low asia_h_swept := false asia_l_swept := false else if t_asia asia_high := math.max(asia_high, high) asia_low := math.min(asia_low, low) // Extend lines until swept if not t_asia and not na(asia_high) if barstate.islast and i_showAsia line.delete(ln_asia_h) line.delete(ln_asia_l) ln_asia_h := line.new(bar_index - 30, asia_high, bar_index + 10, asia_high, color=i_c_asia_line, style=line.style_dashed, width=1) ln_asia_l := line.new(bar_index - 30, asia_low, bar_index + 10, asia_low, color=i_c_asia_line, style=line.style_dashed, width=1) // --------------------------------------------------------------------------------------------------------- // LONDON HIGH & LOW TRACKER // --------------------------------------------------------------------------------------------------------- var float london_high = na var float london_low = na var line ln_lon_h = na var line ln_lon_l = na var bool lon_h_swept = false var bool lon_l_swept = false if t_london and not t_london[1] london_high := high london_low := low lon_h_swept := false lon_l_swept := false else if t_london london_high := math.max(london_high, high) london_low := math.min(london_low, low) if not t_london and not na(london_high) if barstate.islast and i_showLondon line.delete(ln_lon_h) line.delete(ln_lon_l) ln_lon_h := line.new(bar_index - 30, london_high, bar_index + 10, london_high, color=i_c_lon_line, style=line.style_solid, width=1) ln_lon_l := line.new(bar_index - 30, london_low, bar_index + 10, london_low, color=i_c_lon_line, style=line.style_solid, width=1) // --------------------------------------------------------------------------------------------------------- // LIQUIDITY SWEEP SIGNALS (During NY Session) // --------------------------------------------------------------------------------------------------------- bool sweep_asia_high = t_ny and not asia_h_swept and not na(asia_high) and (high > asia_high) and (close < asia_high) bool sweep_asia_low = t_ny and not asia_l_swept and not na(asia_low) and (low < asia_low) and (close > asia_low) bool sweep_lon_high = t_ny and not lon_h_swept and not na(london_high) and (high > london_high) and (close < london_high) bool sweep_lon_low = t_ny and not lon_l_swept and not na(london_low) and (low < london_low) and (close > london_low) if sweep_asia_high asia_h_swept := true if sweep_asia_low asia_l_swept := true if sweep_lon_high lon_h_swept := true if sweep_lon_low lon_l_swept := true plotshape(sweep_lon_high, "London High Swept", shape.triangledown, location.abovebar, color=#EF4444, size=size.small, text="LONDON HIGH SWEPT ($$$)") plotshape(sweep_lon_low, "London Low Swept", shape.triangleup, location.belowbar, color=#10B981, size=size.small, text="LONDON LOW SWEPT ($$$)") plotshape(sweep_asia_high, "Asia High Swept", shape.triangledown, location.abovebar, color=#F59E0B, size=size.small, text="ASIA HIGH SWEPT") plotshape(sweep_asia_low, "Asia Low Swept", shape.triangleup, location.belowbar, color=#38BDF8, size=size.small, text="ASIA LOW SWEPT") // --------------------------------------------------------------------------------------------------------- // EQUAL HIGHS (EQH) & EQUAL LOWS (EQL) DETECTION // --------------------------------------------------------------------------------------------------------- float ph = ta.pivothigh(high, i_swing_len, i_swing_len) float pl = ta.pivotlow(low, i_swing_len, i_swing_len) var float prev_ph = na var int prev_ph_idx = na var float prev_pl = na var int prev_pl_idx = na float tolerance = i_eq_ticks * syminfo.mintick if not na(ph) if not na(prev_ph) and math.abs(ph - prev_ph) <= tolerance // Equal Highs detected! if i_showEqhEql line.new(prev_ph_idx, prev_ph, bar_index - i_swing_len, ph, color=color.new(#EF4444, 20), width=2, style=line.style_dotted) label.new(bar_index - i_swing_len, ph, "EQH ($$$ BSL)", color=color.new(color.black, 100), textcolor=#EF4444, style=label.style_none, size=size.tiny) prev_ph := ph prev_ph_idx := bar_index - i_swing_len if not na(pl) if not na(prev_pl) and math.abs(pl - prev_pl) <= tolerance // Equal Lows detected! if i_showEqhEql line.new(prev_pl_idx, prev_pl, bar_index - i_swing_len, pl, color=color.new(#10B981, 20), width=2, style=line.style_dotted) label.new(bar_index - i_swing_len, pl, "EQL ($$$ SSL)", color=color.new(color.black, 100), textcolor=#10B981, style=label.style_none, size=size.tiny) prev_pl := pl prev_pl_idx := bar_index - i_swing_len // --------------------------------------------------------------------------------------------------------- // ALERTS // --------------------------------------------------------------------------------------------------------- alertcondition(sweep_lon_high, title="London High Swept", message="[Liquidity Edge] 🩸 London High Buy-Side Liquidity Swept on {{ticker}}! Watch for Bearish Displacement.") alertcondition(sweep_lon_low, title="London Low Swept", message="[Liquidity Edge] 🚀 London Low Sell-Side Liquidity Swept on {{ticker}}! Watch for Bullish Displacement.")