The rules at a glance
- Levels: the previous day's high and low, or recent swing highs and lows, where stop orders tend to sit
- The sweep: a candle trades through the level but closes back on the other side, in the far half of its own range
- Entry: at the close of the sweep candle, against the sweep: short after a high is swept, long after a low is swept
- Stop loss: 2 pips beyond the tip of the sweep's wick
- Target: twice the risk (2R)
- Filters: each level is traded once, between 8 a.m. and 5 p.m. London time (12:30 to 21:30 IST in summer, 13:30 to 22:30 IST in winter)
What "liquidity" means here
In smart money concepts, a style popularised online by the Inner Circle Trader (ICT) community, liquidity means orders waiting to be filled. Above an obvious high sit the stop losses of traders who are short, plus buy-stop orders from traders waiting to buy a breakout. Together, that's called buy-side liquidity. Below an obvious low sit the stops of traders who are long, plus sell stops from breakout sellers: sell-side liquidity.
A large order needs someone on the other side. A big seller gets filled more easily when a burst of buy stops goes off above a high, because those stops are all buy orders arriving at once. When that burst is used up and nobody else is buying, the price can snap back below the level. That spike and snap-back is the sweep.
SMC material often tells this as a story of banks hunting retail traders' stops. Some bank dealers have been fined for trying to trigger clients' stop orders (the UK's Financial Conduct Authority found this in 2014), but that was misconduct by dealers who could see those orders. There's no evidence the market as a whole is out to hit your stop, and you don't need that story for the setup to make sense. Stops cluster at obvious levels, they get triggered, and once the burst of orders is over the move can fade. That's all the strategy relies on.
Sweep or breakout? The close decides
| Liquidity sweep | Breakout | |
|---|---|---|
| First move | Trades through the level | Trades through the level |
| Candle close | Back on the original side of the level | Beyond the level |
| What usually follows | A move back the other way | More movement in the breakout's direction |
| How to trade it | Against the sweep, stop beyond the wick | With the break, as in the London breakout or break and retest |
The first few minutes look the same in both cases. That's why this strategy never enters while the candle is still forming. It waits for the close, and only a close back inside the level, in the far half of the candle's range, counts.
Where liquidity sits
- The previous day's high and low. Among the most watched levels, and the ones the script uses by default.
- Equal highs and equal lows. Two or three highs at nearly the same price look like strong resistance, which is exactly why stops pile up just above them.
- The Asian session high and low. For gold and the euro and pound pairs, London often runs one side of the overnight range before choosing a direction.
- Round numbers. Prices such as 4,300.00 on gold or 1.1700 on EURUSD attract orders.
- The week's high and low. Fewer signals, at levels more traders watch.
The rules, step by step
1. Mark the levels before the session
Before London opens, draw the previous day's high and low. On most TradingView forex and gold feeds the daily candle closes at 5 p.m. New York time, which is 02:30 IST in summer and 03:30 IST in winter, so "the previous day" means the day that ended then. The script can use recent swing highs and lows instead.
2. Wait for a candle to sweep the level
For a short, a candle has to trade above the level and then close back below it, in the lower half of its own range. For a long, it trades below the level and closes back above it, in the upper half. A close back inside but near the extreme is a weak rejection, and the script skips it. The candle before the sweep must also have closed on the original side of the level; if the price had already closed beyond it, that was a breakout.
3. Enter at the close, stop beyond the wick
Enter as the sweep candle closes. The stop goes 2 pips beyond the tip of the wick, because if the price goes past the high of the sweep, the idea is wrong. The target is twice the risk.
4. Trade each level once, in the main session
Once a level has been swept and traded, it's used. Trade only between 8 a.m. and 5 p.m. London time, when London and New York give the move enough volume to mean something. Outside that window, in the New York afternoon and the Asian session, volume is thinner and a wick through a level means less.
5. Optional: wait for a shift in structure
Many SMC traders don't enter at the sweep candle. They drop to a lower timeframe and wait for a market structure shift (MSS, also called a change of character or CHoCH): the price breaks the last small swing low after sweeping a high. It gives fewer, later entries, and the stop can be wider or tighter depending on where you put it. The script doesn't include it. If you trade it by hand, test whether it improves your results before you rely on it.
Worked example: XAUUSD, 15-minute chart
The previous day's high is 4,312.40. Gold makes two highs just under it, which adds to the stops sitting above. During the London session, a candle spikes to 4,318.90, $6.50 through the level, and closes at 4,309.80, back below the high and in the lower half of its range (the midpoint is 4,313.80). That's a short signal.
| XAUUSD short | |
|---|---|
| Entry | 4,309.80 |
| Stop loss | 4,319.10 (the wick high 4,318.90 plus 2 pips), $9.30 away |
| Target (2R) | 4,291.20, $18.60 away |
| Account and risk | $10,000, risking 1% = $100 |
| Lot size | $100 ÷ ($9.30 × 100 ounces) = 0.107, rounded down to 0.10 lots |
| Loss if the stop is hit | $93.00 |
| Profit at the target | $186.00 |
One lot of gold is 100 ounces, so a $1 move is $100 a lot and $10 on 0.10 lots. In this example the target is reached 3 hours 45 minutes after the entry. This page counts one gold pip as $0.10, as PipLedger's calculators do, so the 2-pip buffer is 20 cents. Some brokers call $0.01 a pip; see gold pip value. The XAUUSD lot size calculator does the sizing for any stop.
Why gold suits sweeps, and what to watch
Gold moves several dollars in minutes and trades heavily in the London and New York sessions, so its daily highs and lows get tested often. That makes it a popular market for this setup. It also makes it fast, so a few things matter more than on a slow pair:
- News candles. A sweep made by a US data release at 8:30 a.m. New York time (18:00 IST in summer, 19:00 IST in winter) can keep going instead of reversing. Many traders don't fade the release candle itself. See gold news trading.
- Spread. Spreads widen around news and the daily rollover, and a wider spread can trigger a stop that the chart's price never touched.
- Trend days. On a strong trend day, gold can push through the previous day's high, pause and keep going. Fading every new high on those days is trading against the trend.
Risk management
- Accept a moderate win rate. At 2R, you need to win about one trade in three just to break even before costs.
- Two sweeps a day at most. One on the high side and one on the low side, which is all the script takes when it uses the previous day's levels.
- Don't widen the stop. If the price goes through the wick high, the sweep has turned into a breakout. Take the loss.
- Keep the risk fixed. 0.5% to 1% a trade. Gold losses add up quickly; the gold risk management guide covers daily limits.
Common mistakes
- Entering before the candle closes. Until it closes, a sweep and a breakout look the same.
- Calling every wick a sweep. A sweep has to go through a level that matters, one other traders can see. A wick through nothing is just noise.
- Stops right at the wick. A second, smaller push often retests the high. The buffer gives it a little room.
- Ignoring the bigger trend. Sweeps against a strong trend fail more often in many traders' experience. Test it with and without a trend filter.
- Learning a new word for every candle. Inducement, order blocks, fair value gaps, CHoCH: SMC has a lot of vocabulary. You don't need all of it to trade one clear setup well.
Backtest it yourself on TradingView
This page doesn't quote a win rate or a profit figure, and you should be wary of anyone who does without showing the test. Results change with the market, the dates, the data feed and the costs you put in. The honest way is to run the test yourself, and the free script below does the work in a couple of minutes.
- Open the chart. On TradingView, open XAUUSD on the 15-minute chart.
- Add the script. Open the Pine Editor from the Pine icon in the panel on the right of the chart (older layouts have it as a tab under the chart), delete the code that's already there, paste this strategy's code and click "Add to chart".
- Put in your costs. Open the strategy's settings and go to Properties. Enter your broker's commission and a little slippage. A test without costs flatters every strategy, and short-term ones most of all.
- Read the Strategy Tester. The panel under the chart shows the net profit, the maximum drawdown, the profit factor, the number of trades and a list of every trade. Click a few trades and check on the chart that each one follows the rules. Trade sizes are shown in units rather than lots: 100,000 units is one lot of a forex pair, and 100 ounces is one lot of gold.
- Change one setting at a time. Compare the previous day's levels with swing levels, the rejection rule on and off, the stop buffer, the session window and the target. Then run the same settings on EURUSD and GBPUSD, where sweeps of the Asian range and the previous day's levels are common too.
As a rough guide, don't trust a result with fewer than 100 trades, a profit factor under 1 once costs are in, or a drawdown you couldn't sit through with real money. Settings tuned to look good on one stretch of history often fail on the next, so check the same settings on dates you didn't tune them on, then demo trade the strategy for a few weeks.
The script sizes each trade from the stop loss and your risk percentage, starts with $10,000 and assumes 1:100 leverage (a 1% margin setting), so the tester doesn't flag margin calls on normal forex trade sizes. Change these under Properties to match your account. By default TradingView fills orders at the open of the candle after the signal, so the fill can differ a little from the signal candle's close.
Download the free Pine Script and PDF
The script is written in Pine Script version 6 for this guide and follows the rules above. It can't read the economic calendar, so skipping news days is up to you. It's free to use, change and share. The PDF is a one-page cheat sheet with the rules, the timings in IST, a worked example and a checklist, to keep next to your chart.
Show the code (Pine Script v6, 79 lines)
//@version=6
// Liquidity Sweep strategy by PipLedger (https://pipledgerfx.com/liquidity-sweep-strategy)
// Trades a wick through the previous day's high or low (or a swing level) that closes back inside the range.
// Free to use and change. For education and backtesting only; not financial advice.
strategy("PipLedger: Liquidity Sweep", shorttitle="Liquidity Sweep", overlay=true, initial_capital=10000, pyramiding=0, default_qty_type=strategy.fixed, default_qty_value=1, margin_long=1, margin_short=1, currency=currency.USD)
// ---------- Inputs
levelSrc = input.string("Previous day high/low", "Liquidity levels", options=["Previous day high/low", "Swing highs/lows"])
swingLen = input.int(10, "Swing strength, for swing levels (bars)", minval=2)
needReject = input.bool(true, "Sweep candle must close in its far half")
useSess = input.bool(true, "Only trade inside the session window")
sess = input.session("0800-1700", "Session window (London time)")
tz = input.string("Europe/London", "Session time zone")
bufPips = input.float(2.0, "Stop buffer beyond the wick (pips)", minval=0.0, step=0.5)
rr = input.float(2.0, "Target (R multiple)", minval=0.5, step=0.25)
pipSize = input.float(0.0, "Pip size (0 = automatic)", minval=0.0, step=0.00001)
riskPct = input.float(1.0, "Risk per trade (% of equity)", minval=0.1, maxval=5.0, step=0.1)
// ---------- Helpers
isGold = syminfo.currency == "USD" and syminfo.type != "stock" and (str.contains(syminfo.ticker, "XAU") or str.contains(syminfo.ticker, "GOLD"))
autoPip = isGold ? 0.1 : syminfo.type == "forex" ? (syminfo.currency == "JPY" ? 0.01 : 0.0001) : syminfo.mintick * 10
pip = pipSize > 0 ? pipSize : autoPip // 0.0001 on EURUSD, 0.01 on USDJPY, 0.10 on XAUUSD
fx = strategy.convert_to_account(1.0) // one unit of the chart's quote currency in account currency (1 on USD-quoted charts)
calcQty(float entry, float stop) =>
float dist = math.abs(entry - stop)
dist > 0 and not na(fx) ? strategy.equity * riskPct / 100 / (dist * syminfo.pointvalue * fx) : 0.0
// ---------- Liquidity levels
pdh = request.security(syminfo.tickerid, "D", high[1], lookahead=barmerge.lookahead_on)
pdl = request.security(syminfo.tickerid, "D", low[1], lookahead=barmerge.lookahead_on)
sh = ta.pivothigh(high, swingLen, swingLen)
slw = ta.pivotlow(low, swingLen, swingLen)
var float swingHi = na
var float swingLo = na
if not na(sh)
swingHi := sh
if not na(slw)
swingLo := slw
hiLvl = levelSrc == "Previous day high/low" ? pdh : swingHi
loLvl = levelSrc == "Previous day high/low" ? pdl : swingLo
// ---------- Sweeps
inSess = not useSess or not na(time(timeframe.period, sess, tz))
barRng = high - low
sweepHigh = not na(hiLvl) and close[1] <= hiLvl and high > hiLvl and close < hiLvl and (not needReject or close < low + barRng * 0.5)
sweepLow = not na(loLvl) and close[1] >= loLvl and low < loLvl and close > loLvl and (not needReject or close > high - barRng * 0.5)
var float usedHi = na
var float usedLo = na
shortSig = sweepHigh and not sweepLow and inSess and strategy.position_size == 0 and (na(usedHi) or hiLvl != usedHi)
longSig = sweepLow and not sweepHigh and inSess and strategy.position_size == 0 and (na(usedLo) or loLvl != usedLo)
// ---------- Orders
if shortSig
float sl = high + bufPips * pip
float tp = close - (sl - close) * rr
float q = calcQty(close, sl)
if q > 0
strategy.entry("Short", strategy.short, qty=q)
strategy.exit("Short exit", "Short", stop=sl, limit=tp)
usedHi := hiLvl
if longSig
float sl = low - bufPips * pip
float tp = close + (close - sl) * rr
float q = calcQty(close, sl)
if q > 0
strategy.entry("Long", strategy.long, qty=q)
strategy.exit("Long exit", "Long", stop=sl, limit=tp)
usedLo := loLvl
// ---------- Chart
plot(hiLvl, "Buy-side liquidity (high)", color=color.new(color.red, 0), style=plot.style_linebr)
plot(loLvl, "Sell-side liquidity (low)", color=color.new(color.teal, 0), style=plot.style_linebr)
plotshape(shortSig, "Sweep of the high", shape.triangledown, location.abovebar, color.red, size=size.small)
plotshape(longSig, "Sweep of the low", shape.triangleup, location.belowbar, color.teal, size=size.small)Trading this from India
The rules work on any gold chart, and TradingView's XAUUSD chart is a fine place to learn and backtest them. To trade gold legally from India, though, use MCX gold futures, including the smaller Gold Mini and Gold Petal contracts, through a SEBI-registered broker. Trading XAUUSD as a CFD with an offshore forex platform isn't allowed for residents under FEMA. MCX gold trades into the late evening, which covers the London and New York hours in this guide. The contract is priced in rupees, so set the script's pip size to match its tick size. The full picture is in is forex trading legal in India and XAUUSD market timings in India.
More strategies with free Pine Scripts: London breakout, break and retest, 9 and 21 EMA crossover, XAUUSD scalping.