Strategy · Pine Script v6 · On the chart

PF probe bos-curv-probe-01-swing-bos-trigger

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

Detects swing break-of-structure (BOS) levels using confirmed pivot highs and lows.

View on GitHub

GitHub stars1on the repository
Pine versionv6current
Lines of code55
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

55 lines of Pine Script v6 from validation/composite-boscurv-pivot-bos-trigger-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 bos-curv-probe-01-swing-bos-trigger — pivot-based break-of-structure
// Clean-room: written from validation goal, not from source.
//
// Purpose: isolates a break-of-structure detector built on `ta.pivothigh` /
// `ta.pivotlow`. The engine surfaces under test are the pivot left/right
// confirmation logic and the cross-bar `var float` last-confirmed-pivot
// state used to detect a close-through-pivot break. BOS triggers are a
// staple of structural strategies; small differences in WHEN a pivot
// confirms (right-bar count) cascade into different break bars.
//
// Validation goal: bit-exact entries on the bar that closes above the most
// recently confirmed pivot high (long) or below the most recently confirmed
// pivot low (short). Pass = identical trade list vs TradingView.
//
// 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 bos-curv-probe-01-swing-bos-trigger", shorttitle="PF_bos01_BOS",
     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)

// ---- last-confirmed pivot state -----------------------------------
var float last_ph = na
var float last_pl = na

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

// ---- break detection (close through last pivot) -------------------
bool bos_long  = not na(last_ph) and close > last_ph and close[1] <= nz(last_ph[1], last_ph)
bool bos_short = not na(last_pl) and close < last_pl and close[1] >= nz(last_pl[1], last_pl)

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

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

Overview

PF probe bos-curv-probe-01-swing-bos-trigger records the most recent confirmed swing points and triggers a long trade when the bar closes above the last pivot high, or a short trade when it closes below the last pivot low. User settings control the number of left and right bars required for pivot confirmation. Plotted directly on the price chart, the strategy reverses positions on opposing breaks and includes no take profit or stop loss exits.

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, Breakout, Support & resistance

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

6 stars

This strategy combines Opening Range Breakout (ORB) mechanics with Inner Circle Trader (ICT) concepts like Fair Value Gaps, Order Blocks, and liquidity grabs. It identifies session opening ranges and generates signals when price breaks out with supporting rela

Strategy v5 BreakoutSMC / ICT / price action
Updated 7 months ago · None stated GitHub repository of Advanced ORB + ICT Strategy

Unicorn Strategy

by oscar811
3 stars

This overlay strategy marks market-structure swings and breaker blocks on the price chart. It can limit a breaker to the candle body, use one or two candles in the same direction, and stop the block at the first break of its center line. Entries can be restric

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

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

Booming Bulls Sniper

by jayadevrana
1 stars

Implements liquidity sweep and prop firm breakout strategies inspired by the Booming Bulls methodology. The script monitors previous-day, previous-week, and current-day highs and lows for liquidity sweeps where price wicks beyond a level without closing past i

Strategy v6 SMC / ICT / price actionSupport & resistance
Updated 2 days ago · MPL-2.0 GitHub repository of Booming Bulls Sniper
1 stars

This strategy plots market structure on the price chart from confirmed swing highs and lows and flags breaks of those levels. Breaks can use the wick or the close, and structure logic can stay standard or include sweeps. ChoCH mode selects Ping, Verify, or bot

Strategy v6 SMC / ICT / price actionSupport & resistance
Updated 2 days ago · None stated GitHub repository of CHOCH-Strategy (Structure Only)

ORB + ICT Backtest Strategy v2

by mccallister-dev
1 stars

This strategy defines opening range breakouts within Asian, London and New York sessions using ATR-based width and buffer filters. It identifies potential entries on breakout after a retest followed by continuation, applying ICT-style context and SMC proxies f

Strategy v6 BreakoutSMC / ICT / price action
Updated 5 weeks ago · None stated GitHub repository of ORB + ICT Backtest Strategy v2

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