Strategy · Pine Script v6 · On the chart

Volume Breakout

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

The Volume Breakout strategy identifies directional price movements confirmed by trading volume spikes and Average True Range thresholds.

View on GitHub

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

40 lines of Pine Script v6 from validation/ta-volume-spike-atr-breakout-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 26 — volume-spike + ATR breakout
// Purpose: parity test for combined ta.sma(volume) spike detection and
// ta.atr-derived close-distance breakout confirmation.
//
//@version=6
strategy("Volume Breakout", overlay=true, initial_capital=1000000, process_orders_on_close=false, pyramiding=1, commission_type=strategy.commission.percent, commission_value=0, slippage=0, default_qty_type=strategy.fixed, default_qty_value=1)

// === Inputs ===
volLen   = input.int(20, "Volume MA Length", minval=5)
volMult  = input.float(1.5, "Volume Spike Multiplier", step=0.1)
atrLen   = input.int(14, "ATR Length", minval=1)
atrMult  = input.float(1.0, "ATR Breakout Multiplier", step=0.1)

// === Indicators ===
volMA    = ta.sma(volume, volLen)
volSpike = volume > volMA * volMult
atrVal   = ta.atr(atrLen)

// === Price breakout with volume confirmation ===
priceBreakUp   = close > close[1] + atrVal * atrMult
priceBreakDown = close < close[1] - atrVal * atrMult

// === Signals ===
longCond  = priceBreakUp and volSpike
shortCond = priceBreakDown and volSpike

if longCond
    strategy.entry("Long", strategy.long)
if shortCond
    strategy.entry("Short", strategy.short)

// === Exit when volume dries up ===
if strategy.position_size > 0 and close < close[1] and volume < volMA
    strategy.close("Long")
if strategy.position_size < 0 and close > close[1] and volume < volMA
    strategy.close("Short")

Overview

Volume Breakout enters long positions when prices rise beyond a volatility-adjusted distance accompanied by above-average volume, and short positions under reverse conditions. Positions close when volume dries up relative to its moving average alongside counter-trend price movement. The strategy operates directly on the main price chart using customizable inputs for volume length, multipliers, and ATR periods. It does not include a predefined stop loss mechanism and allows single-order pyramiding.

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

Volume, Volatility & bands, Breakout

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

  • The strategy can add several entries in the same direction
  • 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
Volume MA Lengthint20volLen
Volume Spike Multiplierfloat1.5volMult
ATR Lengthint14atrLen
ATR Breakout Multiplierfloat1.0atrMult
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

BB and KC Strategy

by hasnocool
106 stars

This strategy identifies breakout momentum by combining Bollinger Bands and Keltner Channels with volume confirmation. It opens long positions when the upper Keltner Channel crosses above the upper Bollinger Band and volume exceeds its moving average. Converse

Strategy v5 Volatility & bandsBreakout
Updated 2 years ago · GPL-3.0 GitHub repository of BB and KC Strategy

VOL/BBW/RSI/15 Strategy

by SammyEnigma
18 stars

This strategy overlays Bollinger Bands on the price chart and trades a long squeeze setup. It enters long when band width is below 0.022 and volume is at least the seven-bar average, using a stop order at the lower band. It places a short order when close cros

Strategy v4 Volatility & bandsVolume
Updated 6 years ago · None stated GitHub repository of VOL/BBW/RSI/15 Strategy

BB Squeeze Breakout

by muammeryldrm42
7 stars

BB Squeeze Breakout is a volatility breakout strategy that identifies consolidation squeezes using Bollinger Band width percentile ranking. When the band width drops below its 25th percentile and price crosses above or below the bands with optional volume conf

Strategy v5 Volatility & bandsBreakout
Updated 3 months ago · MIT GitHub repository of BB Squeeze Breakout

Bollinger Squeeze STEPFUN

by eltonaguiar
4 stars

This strategy detects Bollinger Band squeezes by measuring band width against a threshold. It waits for a confirmed breakout in either direction when bands expand, using optional volume confirmation. Long and short signals trigger on breakout after squeeze. Po

Strategy v5 Volatility & bandsBreakout
Updated today · None stated GitHub repository of Bollinger Squeeze STEPFUN

This strategy enters long when the close breaks above the prior lookback high and volume exceeds its simple moving average, but only if a VIX regime score is at least three. The score counts whether the VIX to three-month VIX ratio and the VIX level sit below

Strategy v5 BreakoutVolatility & bands Repaints
Updated 10 months ago · MIT GitHub repository of Auto Breakout Strategy mit VIX Heatmap Gate

Momentum Breakout Strategy

by adminalphabots
2 stars

This strategy plots on the price chart and enters when price closes beyond the prior lookback high or low and also beyond a shorter confirmation range. Long, short, or both directions can be enabled. Optional filters require volume above a volume average or a

Strategy v5 BreakoutVolatility & bands
Updated 8 months ago · MIT GitHub repository of Momentum Breakout 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