Strategy · Pine Script v6 · On the chart

M15 Liquidity Sweep Scalp

by Snappni

This strategy identifies liquidity sweep scalp entries on lower timeframes by analyzing 15-minute higher-timeframe candles.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code54
Settings8inputs
LicenceMIT
Last update4 months ago6 Jun 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

54 lines of Pine Script v6 from apps/server/src/pine-corpus/strategy-collection-adapted/03_十五分钟流动性扫荡剥头皮_项目适配版.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

03_十五分钟流动性扫荡剥头皮_项目适配版.pine
//@version=6
strategy("Doc03 M15 Liquidity Sweep Scalp - Project Adapted", overlay=true, pyramiding=0, initial_capital=10000)

// Source: user-provided strategy collection - strategy 3
// Logic summary:
// 1. Detect a large 15m range candle with balanced wicks.
// 2. In 15m uptrend, buy when price revisits the lower 75% area.
// 3. Stop around 30% area. Target projects part of the range upward.
// 4. This project version can run on 1m or 5m and approximates the original 1m execution.
// Compile confidence: 90/100. Profit confidence: 20/100.

htf = input.timeframe("15", "Range candle timeframe")
emaFastLen = input.int(9, "Trend EMA fast", minval=1)
emaSlowLen = input.int(50, "Trend EMA slow", minval=2)
bodyLookback = input.int(10, "Average body lookback", minval=2)
bodyFactor = input.float(1.0, "Large body factor", minval=0.1, step=0.1)
minWickBodyRatio = input.float(0.10, "Min wick/body ratio", minval=0.0, step=0.05)
maxWickImbalance = input.float(0.50, "Max wick imbalance", minval=0.0, step=0.05)
targetRangeMult = input.float(0.50, "Target above range", minval=0.1, step=0.1)

hOpen = request.security(syminfo.tickerid, htf, open[1])
hHigh = request.security(syminfo.tickerid, htf, high[1])
hLow = request.security(syminfo.tickerid, htf, low[1])
hClose = request.security(syminfo.tickerid, htf, close[1])
hEmaFast = request.security(syminfo.tickerid, htf, ta.ema(close, emaFastLen)[1])
hEmaSlow = request.security(syminfo.tickerid, htf, ta.ema(close, emaSlowLen)[1])
hAvgBody = request.security(syminfo.tickerid, htf, ta.sma(math.abs(close - open), bodyLookback)[1])

hBody = math.abs(hClose - hOpen)
hUpperWick = hHigh - math.max(hOpen, hClose)
hLowerWick = math.min(hOpen, hClose) - hLow
hRange = math.max(hHigh - hLow, syminfo.mintick)
wickDiff = math.abs(hUpperWick - hLowerWick)
wickMax = math.max(math.max(hUpperWick, hLowerWick), syminfo.mintick)

largeBody = hBody >= hAvgBody * bodyFactor
validWicks = hUpperWick >= hBody * minWickBodyRatio and hLowerWick >= hBody * minWickBodyRatio and wickDiff / wickMax <= maxWickImbalance
upTrend = hEmaFast > hEmaSlow
validRange = largeBody and validWicks and upTrend

entryLevel = hLow + hRange * 0.75
stopLevel = hLow + hRange * 0.30
targetLevel = hHigh + hRange * targetRangeMult

longSignal = strategy.position_size == 0 and validRange and close <= entryLevel and close > stopLevel

if longSignal
    strategy.entry("Long", strategy.long)

if strategy.position_size > 0
    strategy.exit("Long Range Exit", "Long", stop=stopLevel, limit=targetLevel)

if strategy.position_size > 0 and close < stopLevel
    strategy.close("Long")

Overview

M15 Liquidity Sweep Scalp verifies a valid range candle using an EMA trend filter, average body size comparison, and wick balance thresholds. In an uptrend, it opens a long position when price retraces into the lower 75% zone of the higher-timeframe candle range. The strategy sets a stop loss at the 30% level of the range and a profit target above the candle high, executing overlay plots directly on the main price chart.

Details

Published by

Snappni on GitHub

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

Trend, Moving averages, Candlestick patterns, Scalping

Markets

Any symbol

Timeframes

M1-M5, M15-H1

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

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

SettingTypeDefaultVariable
Range candle timeframetimeframe15htf
Trend EMA fastint9emaFastLen
Trend EMA slowint50emaSlowLen
Average body lookbackint10bodyLookback
Large body factorfloat1.0bodyFactor
Min wick/body ratiofloat0.10minWickBodyRatio
Max wick imbalancefloat0.50maxWickImbalance
Target above rangefloat0.50targetRangeMult
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

257 stars

This overlay strategy marks short-term turning points on the price chart and enters SPY option-style trades from them. It plots simple moving averages of highs and lows, draws up and down reversal arrows, and colors bars when a short-term extreme coincides wit

Strategy v5 TrendMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of SPY Options Trading - Alert

Pin Bar Magic v1

by Alorse
330 stars

This strategy trades price action pin bar patterns aligned with moving average trend alignment on the main price chart. It defines uptrends or downtrends using a fan arrangement of three moving averages (6 EMA, 18 EMA, and 50 SMA). Entry conditions require a b

Strategy v4 Candlestick patternsTrend
Updated 2 months ago · None stated GitHub repository of Pin Bar Magic v1

This strategy generates trading signals on the 5-minute price chart using Williams Fractals for trend reversals, combined with EMA fast and slow trend filters and optional RSI confirmation. Long entries trigger on bullish fractals aligned with rising EMA and R

Strategy v5 TrendOscillators & momentum
Updated 2 years ago · GPL-3.0 GitHub repository of 5min Williams Fractals Scalping (3commas)
53 stars

This strategy trades EUR/USD on the price chart using a fast and slow exponential moving average crossover filtered by RSI. It enters long when the fast EMA crosses above the slow EMA while RSI is above 50 and below the overbought level, and enters short on th

Strategy v6 TrendMoving averages
Updated 2 months ago · MPL-2.0 GitHub repository of EUR/USD EMA9-21 + RSI Scalping Strategy

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