Strategy · Pine Script v5 · On the chart

EQH/EQL Sweep

by muammeryldrm42

This strategy detects equal highs and equal lows from swing pivots when two pivots sit within an ATR tolerance.

View on GitHub

Repaints

GitHub stars7on the repository
Pine versionv5runs as is
Lines of code41
Settings2inputs
LicenceMIT
Last update3 months ago8 Jul 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

41 lines of Pine Script v5 from public/code/smc__eq_sweep.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

smc__eq_sweep.pine
//@version=5
strategy("EQH/EQL Sweep", overlay=true,
         default_qty_type=strategy.percent_of_equity, default_qty_value=10)

swingLb = input.int(5, "Swing LB")
tolMult = input.float(0.15, "Tolerance ATR")

atrVal = ta.atr(14)
tol    = atrVal * tolMult
ph     = ta.pivothigh(swingLb, swingLb)
pl     = ta.pivotlow(swingLb, swingLb)

var float h1 = na, var float h2 = na
var float l1 = na, var float l2 = na
if not na(ph)
    h2 := h1, h1 := ph
if not na(pl)
    l2 := l1, l1 := pl

eqh = not na(h1) and not na(h2) and math.abs(h1 - h2) <= tol ? math.max(h1, h2) : na
eql = not na(l1) and not na(l2) and math.abs(l1 - l2) <= tol ? math.min(l1, l2) : na

longSweep  = not na(eql) and low[1] < eql and close[1] > eql and close > open
shortSweep = not na(eqh) and high[1] > eqh and close[1] < eqh and close < open

if longSweep and strategy.position_size == 0
    sl   = low[1] - 0.3 * atrVal
    risk = close - sl
    strategy.entry("EQ Long", strategy.long)
    strategy.exit("X", "EQ Long", stop=sl, limit=close + risk * 3)

if shortSweep and strategy.position_size == 0
    sl   = high[1] + 0.3 * atrVal
    risk = sl - close
    strategy.entry("EQ Short", strategy.short)
    strategy.exit("X", "EQ Short", stop=sl, limit=close - risk * 3)

plot(eqh, "EQH", color.red, 2, plot.style_circles)
plot(eql, "EQL", color.green, 2, plot.style_circles)
plotshape(longSweep,  "L", shape.triangleup,   location.belowbar, color.lime)
plotshape(shortSweep, "S", shape.triangledown, location.abovebar, color.red)

Overview

A long entry follows a wick below an equal low that closes back above it on a bullish bar; a short entry follows a wick above an equal high that closes back below it on a bearish bar. It enters only when flat, sizing at ten percent of equity, with an ATR stop beyond the sweep and a take profit at three times risk. Equal levels and triangles plot on the price chart. Signals can change before the live bar closes.

Details

Published by

muammeryldrm42 on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

SMC / ICT / price action, Support & resistance

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • Signals can change on the live bar or after it closes (repainting)

Topics

cryptofuturessodexsosovaluestrategyvaluechain

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Swing LBint5swingLb
Tolerance ATRfloat0.15tolMult
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

Daily Bias + FVG Strategy

by TradersPost
218 stars

This overlay strategy plots previous-day high and low, the daily open, and fair value gap zones on the price chart. It takes entries on a selectable timeframe when the FVG requirement and an optional session window allow them, then uses an ATR or fixed pip sto

Strategy v6 SMC / ICT / price actionSupport & resistance Repaints
Updated 3 months ago · None stated GitHub repository of Daily Bias + FVG Strategy
105 stars

Gold Scalping BOS & CHoCH is an overlay strategy designed for detecting market structure shifts. It calculates rolling swing highs and lows to identify Break of Structure (BOS) and Change of Character (CHoCH) events. Long signals trigger when bullish BOS and C

Strategy v6 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · None stated GitHub repository of Gold Scalping BOS & CHoCH

P404 Smoke

by Musyimi97
16 stars

P404 Smoke is a price-chart strategy that sequences an optional higher-timeframe EMA bias, a liquidity range from recent pivots, a sweep of buy-side or sell-side liquidity, and a market structure shift within a set bar window. Comments state it then looks for

Strategy v5 SMC / ICT / price actionSupport & resistance
Updated 6 months ago · MIT GitHub repository of P404 Smoke

FairValueGap C003

by ruckard
13 stars

FairValueGap C003 is an overlay strategy that identifies Fair Value Gaps (FVG) and opens trades expecting price to return and fill the gap. It calculates the distance between current price levels and recent gap boundaries to aim for partial or full gap fills.

Strategy v5 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · None stated GitHub repository of FairValueGap C003

SMC Strategy

by tsunafire
10 stars

SMC Strategy is a Pine Script v5 overlay strategy based on smart money concepts. It flags market structure shifts from ten-bar highs and lows, draws bullish and bearish order blocks as rectangles when that option is on, and marks liquidity sweeps with short li

Strategy v5 SMC / ICT / price actionSupport & resistance Repaints
Updated 2 years ago · None stated GitHub repository of SMC Strategy

XXX

by MeridianAlgo
9 stars

This multi-timeframe scalping strategy plots moving averages alongside Smart Money Concepts elements on the price chart. It calculates trend signals using configurable moving average types like ALMA, Hull MA, or TEMA across alternate timeframes. It also plots

Strategy v5 TrendMoving averages Repaints
Updated 4 months ago · MIT GitHub repository of XXX

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers