Strategy · Pine Script v6 · On the chart

Parity Probe 02 - CHoCH/BOS Isolator

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

This Pine Script v6 strategy isolates and tests market structure events, specifically Break of Structure (BOS) and Change of Character (CHoCH).

View on GitHub

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

83 lines of Pine Script v6 from validation/analyzer-parity-choch-bos-isolator-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
//
// Parity probe 02 — CHoCH / BOS structural-break isolator
//
// Purpose: isolate the VCP integration probe family's bullConfluence /
// _bosLong gating, which depends on market-structure events
// (Break-of-Structure ``bosUp``/``bosDown`` and Change-of-Character
// ``chochUp``/``chochDown``). That family fires one extra long entry on
// 2025-05-12 12:15 UTC because chochUp = TRUE there
// in the engine — its prior-bar bosDown at 11:45 flipped structureDir to
// -1, then close=2542.93 > prevSwingHigh=2526.61 satisfied chochUp.
// vcp-probe-01 already shows ``ta.pivothigh/pivotlow`` match TV
// bit-for-bit, so the disagreement must come from how
// lastSwingHigh/Low and prevSwingHigh/Low evolve through the
// pivot-update side effects, or from the inequality direction in the
// bos/choch booleans. This probe puts the entire VCP-style swing-tracking
// scaffold on its own and trades ONLY on those four boolean events
// (one-bar holding period) so the trade list itself becomes the diff
// against TV.
//
// Trade shape: pyramiding=0, single-contract, exit on the next bar
// after entry so each row in the trade export is exactly one
// bos_up / bos_dn / choch_up / choch_dn firing. No FVG, no MTF, no
// confluence stack — pure swing-state logic.
//
// TV setup: 15m chart on BINANCE:ETHUSDT.P, same window as
// data/ohlcv_ETH-USDT-USDT_15m.csv. Export "List of Trades" to
// ``tv_trades.csv`` in this folder.
//@version=6
strategy("Parity probe 02 - choch/bos isolator", shorttitle="par_p02", 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=0, process_orders_on_close=false)

// ---- inputs (mirror VCP defaults) ----------------------------------
int i_pivot = input.int(5, "Pivot Strength", minval=2, maxval=20)

// ---- swing tracking (BYTE-IDENTICAL to the VCP integration probe family) -----
float pivotHigh = ta.pivothigh(high, i_pivot, i_pivot)
float pivotLow  = ta.pivotlow(low,   i_pivot, i_pivot)

var float lastSwingHigh = na
var float lastSwingLow  = na
var float prevSwingHigh = na
var float prevSwingLow  = na
var int   structureDirection = 0

if not na(pivotHigh)
    prevSwingHigh := lastSwingHigh
    lastSwingHigh := pivotHigh

if not na(pivotLow)
    prevSwingLow := lastSwingLow
    lastSwingLow := pivotLow

bool bosUp     = not na(lastSwingHigh) and close > lastSwingHigh and structureDirection <= 0
bool bosDown   = not na(lastSwingLow)  and close < lastSwingLow  and structureDirection >= 0
bool chochUp   = not na(prevSwingHigh) and close > prevSwingHigh and structureDirection < 0
bool chochDown = not na(prevSwingLow)  and close < prevSwingLow  and structureDirection > 0

if bosUp or chochUp
    structureDirection := 1
if bosDown or chochDown
    structureDirection := -1

// ---- one-bar trades on every structural event ----------------------
// We ENTRY-on-event and CLOSE-on-next-bar so each event is bracketed
// into a single trade row in the export. Exporting the event TYPE
// (long entry vs short entry) plus the timestamp lets us diff
// engine vs TV with no other state to confound the comparison.
bool any_bull_event = bosUp   or chochUp
bool any_bear_event = bosDown or chochDown

if any_bull_event and strategy.position_size == 0
    string c_bu = bosUp ? "bosUp" : "chochUp"
    strategy.entry("BU", strategy.long, comment=c_bu)

if any_bear_event and strategy.position_size == 0
    string c_bd = bosDown ? "bosDown" : "chochDown"
    strategy.entry("BD", strategy.short, comment=c_bd)

// Exit at next bar's open (process_orders_on_close=false default)
if strategy.position_size != 0 and bar_index > strategy.opentrades.entry_bar_index(0)
    strategy.close_all(comment="event flatten")

Overview

Using swing points calculated from configurable pivot strength settings, it tracks structural direction and triggers entries whenever a bullish or bearish structural break occurs. Positions are entered when flat and held for a single bar to generate isolated trade events. It plots directly on the price chart and features no stop loss or take profit targets.

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 Strengthint5i_pivot
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