Strategy · Pine Script v6 · On the chart

VCP probe 01 - pivot strength 5

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

This strategy identifies pivot highs and pivot lows using standard pivot detection functions to evaluate market structure.

View on GitHub

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

55 lines of Pine Script v6 from validation/composite-vcp-pivot-strength-5-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
//
// VCP probe 01 — pivot detection at strength 5
//
// Purpose: isolate the market-structure half of the VCP integration probe
// family. That family detects
// swing highs/lows with ``ta.pivothigh(high, pivotStrength, pivotStrength)``
// and ``ta.pivotlow(low, pivotStrength, pivotStrength)`` at the default
// ``pivotStrength = 5``. Those pivots seed BOS / CHoCH structure flips,
// which then gate every entry. If TV and the engine disagree on WHEN a
// strength-5 pivot confirms (or its value), VCP's structureDirection
// flips on different bars and the whole confluence stack desyncs.
//
// This probe routes a trivial entry/exit through ONLY the pivot pair —
// no FVG, no MTF, no RSI, no volume — so any TV/engine drift here is
// attributable to ``ta.pivothigh`` / ``ta.pivotlow`` left-bar+right-bar
// confirmation precision at strength 5.
//
// Trade shape: long-only, pyramiding=1. Enter long on the bar that
// confirms a strength-5 pivot LOW (buy-the-dip on the confirmation
// bar). Close the long on the next confirmed strength-5 pivot HIGH.
// Both are computed with the EXACT VCP pivot signature.
//
// TV setup: 15m chart, ETH-USDT-USDT, same window as
// data/ohlcv_ETH-USDT-USDT_15m.csv. Export the trade list to trades.csv
// in this folder.
//@version=6
strategy("VCP probe 01 - pivot strength 5", shorttitle="VCP_p01",
     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 (mirror VCP's defaults) --------------------------------
int i_pivot = input.int(5, "Pivot Strength", minval=2, maxval=20)

// ---- pivot detection — IDENTICAL signature to VCP ------------------
float pivotHigh = ta.pivothigh(high, i_pivot, i_pivot)
float pivotLow  = ta.pivotlow(low,   i_pivot, i_pivot)

// Confirmation events: na/non-na rising edges. ta.pivothigh returns
// the pivot price ``i_pivot`` bars AFTER the actual swing bar (i.e.
// once enough right-bars exist). VCP keys structureDirection off
// exactly these events.
bool pivotHighConfirmed = not na(pivotHigh)
bool pivotLowConfirmed  = not na(pivotLow)

// ---- trivial entry / exit ------------------------------------------
if pivotLowConfirmed and strategy.position_size == 0
    strategy.entry("L", strategy.long, qty=1, comment="pivot low entry")

if pivotHighConfirmed and strategy.position_size > 0
    strategy.close("L", comment="pivot high exit")

Overview

Plotted directly overlaying the price chart, it enters a fixed long position on the exact bar where a pivot low is confirmed. The long position is closed once a pivot high is confirmed. The primary input allows adjustment of the pivot strength parameter, changing the required left and right bar counts. The strategy includes no stop loss or take profit mechanisms.

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

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

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
330 stars

This strategy divides a fixed price range between an upper and a lower limit into equally spaced grid levels and plots them on the price chart. It marks a buy when price crosses down through a grid and a sell when price crosses up through a grid, using either

Strategy v5 Support & resistanceMean reversion Repaints
Updated 2 months ago · None stated GitHub repository of Grid Bot Simulator [Alorse]
257 stars

This strategy calculates dynamic support and resistance levels using pivot highs and lows alongside a custom smoothed trend filter and a 3-period EMA. It identifies entry opportunities when price breaks out relative to the trend filter and short-term EMA cross

Strategy v5 TrendSupport & resistance Repaints
Updated 6 weeks ago · None stated GitHub repository of 30s - ES 1m Strategy Candle Bar

STRG-HOLP

by harryguiacorn
219 stars

STRG-HOLP is a trading strategy that identifies High of Low Period (HOLP) and Low of High Period (LOHP) breakout setups. It tracks the lowest low or highest high over a user-defined lookback window. A long trade opens when the close breaks above the high of th

Strategy v5 BreakoutSupport & resistance
Updated 1 year ago · None stated GitHub repository of STRG-HOLP
106 stars

This script monitors opening gap conditions and breakout behavior relative to the first candle's range across up to twenty configurable stock tickers. It detects whether following bars remain inside the opening range before breaking out, displaying the status

Strategy v4 Screeners & dashboardsBreakout Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 1St Bar GAP+BkOut Screener v2 by RM

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