Strategy · Pine Script v6 · On the chart

PF probe liquidity-sweep-probe-integration

by pineforge-4pass· code credited to PineForge contributors 2026

This strategy detects pivot highs and lows to establish swing structure, then identifies liquidity sweeps where price breaks the wick of the most recent pivot and closes back inside it.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code89
Settings2inputs
LicenceApache-2.0
Last update5 days ago23 Oct 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

89 lines of Pine Script v6 from validation/composite-liqsweep-integration-01/strategy.pine, published under Apache-2.0. Keep the author's credit and licence lines when you reuse it.

strategy.pine
// This Pine Script® code is licensed under Apache-2.0
// SPDX-License-Identifier: Apache-2.0
// © PineForge contributors 2026
//
// PF probe liquidity-sweep-probe-integration — swing + sweep + reentry
// Clean-room: written from validation goal, not from source.
//
// Purpose: composes the three surfaces isolated by
// `liquidity-sweep-probe-01..03` (pivot-confirmed HH/LL swing structure,
// sweep-bar wick-pierce-and-close-back, one-bar-wait reentry on
// continuation) into one strategy. Long entries require a recent
// higher-high context AND a sweep-of-lows AND a one-bar-delayed
// continuation candle; short symmetric. Verifies that the engine carries
// pivot, sweep, and latch state correctly across many bars.
//
// Validation goal: bit-exact trade list against TradingView's broker
// emulator on the reference 15-minute ETH-USDT-USDT feed.
//
// TV setup: 15m chart, ETH-USDT-USDT (Binance USDT-M Perpetual). Full window
// matching corpus/data/ohlcv_ETH-USDT-USDT_15m.csv. Strategy properties:
// leave defaults from script header. Export "List of trades" → tv_trades.csv.
//@version=6
strategy("PF probe liquidity-sweep-probe-integration", shorttitle="PF_lspINT",
     overlay=true, initial_capital=1000000,
     commission_type=strategy.commission.percent, commission_value=0,
     slippage=0, default_qty_type=strategy.fixed, default_qty_value=1,
     pyramiding=1, process_orders_on_close=false)

// ---- inputs --------------------------------------------------------
int i_left  = input.int(5, "Pivot left bars",  minval=1)
int i_right = input.int(5, "Pivot right bars", minval=1)

// ---- pivot detection ----------------------------------------------
float ph = ta.pivothigh(high, i_left, i_right)
float pl = ta.pivotlow(low,   i_left, i_right)

// ---- swing state (last + previous) --------------------------------
var float last_ph = na
var float prev_ph = na
var float last_pl = na
var float prev_pl = na

if not na(ph)
    prev_ph := last_ph
    last_ph := ph
if not na(pl)
    prev_pl := last_pl
    last_pl := pl

// ---- structural-direction flags (latched until next confirmed pivot)
var bool struct_bull = false
var bool struct_bear = false

if not na(ph) and not na(prev_ph)
    if ph > prev_ph
        struct_bull := true
        struct_bear := false
if not na(pl) and not na(prev_pl)
    if pl < prev_pl
        struct_bear := true
        struct_bull := false

// ---- sweep detection ----------------------------------------------
bool sweep_high = not na(last_ph) and high > last_ph and close < last_ph
bool sweep_low  = not na(last_pl) and low  < last_pl and close > last_pl

// ---- one-bar wait latches -----------------------------------------
var int wait_long  = 0
var int wait_short = 0

if sweep_low and struct_bull
    wait_long := 1
else if wait_long > 0
    wait_long := wait_long - 1

if sweep_high and struct_bear
    wait_short := 1
else if wait_short > 0
    wait_short := wait_short - 1

bool fire_long  = wait_long  == 0 and wait_long[1]  == 1 and close > open
bool fire_short = wait_short == 0 and wait_short[1] == 1 and close < open

// ---- order routing -------------------------------------------------
if fire_long and strategy.position_size <= 0
    strategy.entry("L", strategy.long, qty=1, comment="integ long")

if fire_short and strategy.position_size >= 0
    strategy.entry("S", strategy.short, qty=1, comment="integ short")

Overview

After a one-bar delay on continuation, it fires long entries on bullish structure with a sweep low or short entries on bearish structure with a sweep high. Entries occur only when flat, with fixed position size of one contract and no stop loss or take profit. The strategy plots signals directly on the price chart and is designed for 15-minute crypto perpetual charts such as ETH-USDT.

Details

Published by

pineforge-4pass on GitHub

Code credit

PineForge contributors 2026, as written in the script's header

Type

Strategy, Pine Script v6

Draws

On the price chart

Category

SMC / ICT / price action, Support & resistance, Breakout, Trend

Markets

Crypto

Timeframes

M15-H1

Risk Notes

  • The strategy enters trades without a stop loss

Topics

algorithmic-tradingbacktestingparitypine-scriptpinescriptquantitative-financetest-corpustradingview

Settings

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

SettingTypeDefaultVariable
Pivot left barsint5i_left
Pivot right barsint5i_right
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

Qtus SMC-Sniper AutoTrader v2 is an automated trading strategy plotted on the price chart that combines Smart Money Concepts (SMC), ICT frameworks, price action patterns, and technical indicators into a multi-factor scoring engine. It enters long or short posi

Strategy v6 SMC / ICT / price actionTrend
Updated 2 months ago · Custom licence GitHub repository of Qtus SMC-Sniper AutoTrader v2

This trend-following strategy executes a classic Donchian channel breakout system designed to cross-validate backtest results against external framework benchmarks. It triggers a long entry when the closing price breaks above the highest high of the prior entr

Strategy v6 BreakoutTrend
Updated today · AGPL-3.0 GitHub repository of Forven S01509 - Simple Donchian 20/10 Breakout
257 stars

This strategy plots running pivot highs as red R circles and pivot lows as blue S circles directly on the price chart. It computes an EMA 3 and a Cto trend line from close prices, then generates long signals on upward EMA-Cto crossovers combined with price pos

Strategy v6 TrendMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of Best Chart 1m Strategy Candle Bar
106 stars

Calculates multi-period logarithmic regression trend channels and deviation bands across up to twenty selectable lookback lengths directly on the price chart. It evaluates channel slopes and Pearson's correlation coefficient to detect market trends and generat

Strategy v5 TrendSupport & resistance Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Advanced Trend Detection Strategy

This trend breakout strategy plots Donchian Channels consisting of upper, lower, and middle bands directly on the main price chart. Long positions enter when price touches the upper channel and pulls back to or below the middle band, placing a stop loss at the

Strategy v6 TrendBreakout
Updated 2 months ago · MPL-2.0 GitHub repository of Donchian Strategy - Dynamic TP, Fixed SL, 1% Risk, Daily Target

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