Strategy · Pine Script v5 · On the chart

Auto Breakout Strategy mit VIX Heatmap Gate

by NinjaEde

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.

View on GitHub

Repaints

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code65
Settings4inputs
LicenceMIT
Last update10 months ago24 Dec 2025

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

65 lines of Pine Script v5 from Auto-breakout-vix.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

Auto-breakout-vix.pine
//@version=5
strategy(
    "Auto Breakout Strategy mit VIX Heatmap Gate",
    overlay=true,
    initial_capital=100000,
    default_qty_type=strategy.percent_of_equity,
    default_qty_value=10
)

// =====================
// VIX HEATMAP REGIME
// =====================
vix   = request.security("CBOE:VIX", timeframe.period, close)
vix3m = request.security("CBOE:VIX3M", timeframe.period, close)

ratio = vix / vix3m

score = 0
score += ratio < 0.98 ? 1 : 0
score += ratio < 0.95 ? 1 : 0
score += vix < 20 ? 1 : 0
score += vix < 15 ? 1 : 0

regimeOK = score >= 3

// =====================
// BREAKOUT LOGIK
// =====================
lookback   = input.int(20, "Breakout Lookback")
volLen     = input.int(20, "Volume SMA")

highestHigh = ta.highest(high, lookback)
volConfirm  = volume > ta.sma(volume, volLen)

breakout = close > highestHigh[1] and volConfirm

// =====================
// ENTRY
// =====================
if breakout and regimeOK
    strategy.entry("Breakout Long", strategy.long)

// =====================
// EXIT (Basis, bewusst simpel)
// =====================
atrLen = input.int(14, "ATR Length")
atrMul = input.float(2.0, "ATR Stop Multiplier")

atr = ta.atr(atrLen)
strategy.exit(
    "Exit",
    from_entry="Breakout Long",
    stop=close - atr * atrMul
)

// =====================
// VISUALS
// =====================
bgcolor(
     score >= 3 ? color.new(color.green, 85) :
     score == 2 ? color.new(color.yellow, 85) :
     color.new(color.red, 85)
)

plot(highestHigh, "Breakout Level", color=color.orange)

Overview

The score counts whether the VIX to three-month VIX ratio and the VIX level sit below fixed thresholds, using same-timeframe CBOE data. It exits with a stop placed an ATR multiple below the current close and sizes each order as a percentage of equity. A background heatmap shows the score, and the breakout level is plotted on the price chart. Entries can change before the live bar closes, and there is no take-profit rule.

Details

Published by

NinjaEde on GitHub

Type

Strategy, Pine Script v5

Draws

On the price chart

Category

Breakout, Volatility & bands, Volume

Markets

Stocks, Indices

Timeframes

Any timeframe

Risk Notes

  • Signals can change on the live bar or after it closes (repainting)

Settings

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

SettingTypeDefaultVariable
Breakout Lookbackint20lookback
Volume SMAint20volLen
ATR Lengthint14atrLen
ATR Stop Multiplierfloat2.0atrMul
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

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

This strategy identifies Minervini Volume Confirmation Patterns fused with Smart Money Concepts for Bursa Malaysia stocks. It plots entry and exit signals with trend lines, boxes and labels directly on the price chart. The strategy enters long positions when v

Strategy v6 SMC / ICT / price actionVolatility & bands
Updated 4 months ago · None stated GitHub repository of Minervini VCP + SmartMCDX KLSE v8

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