OPEN-SOURCE SCRIPT
Aggiornato

Breakout Pullback Continuation

44
//version=5
indicator("Breakout Pullback Continuation", overlay=true)

// === Parameters ===
lookback = 20 // Look for breakouts above this many bars
volumeFactor = 1.3 // How much volume needs to exceed average
pullbackDepth = 3 // Max bars to wait for pullback + green

// === Track State ===
var float breakoutLevel = na
var int breakoutBar = na
volumeSMA = ta.sma(volume, 20)

// === Detect Breakout ===
recentHigh = ta.highest(high, lookback)
breakout = close > recentHigh[1]

if breakout
breakoutLevel := close
breakoutBar := bar_index

// === Check for Pullback After Breakout
pullbackOccurred = na(breakoutLevel) ? false : close < breakoutLevel and bar_index > breakoutBar

// === Check for Confirmation Candle
greenCandle = close > open
decentRange = (high - low) > (close * 0.003)
volumeSpike = volume > volumeSMA * volumeFactor

confirmation = pullbackOccurred and greenCandle and decentRange and volumeSpike and (bar_index - breakoutBar <= pullbackDepth)

// === Signal Plot ===
plotshape(confirmation, title="Pullback Continuation", location=location.belowbar, color=color.lime, style=shape.triangleup)
alertcondition(confirmation, title="Breakout Pullback Alert", message="🚀 {{ticker}} breakout-pullback-confirmation at {{close}}")
Note di rilascio
//version=5
indicator("Breakout Pullback Continuation (Simple)", overlay=true)

// === SETTINGS ===
lookback = 20 // How far back to define a breakout
pullbackBars = 5 // How many bars we allow a pullback before confirmation

// === TRACK BREAKOUT LEVEL ===
recentHigh = ta.highest(high, lookback)
breakout = close > recentHigh[1]

// === Store breakout info (price + bar index)
var float breakoutLevel = na
var int breakoutBar = na

if breakout
breakoutLevel := close
breakoutBar := bar_index

// === Define Pullback + Confirmation ===
// Pullback = close drops below breakout level AFTER breakout
pullback = na(breakoutLevel) ? false : close < breakoutLevel and bar_index > breakoutBar

// Confirm bar = green candle after pullback, within N bars from breakout
greenConfirm = close > open and bar_index - breakoutBar <= pullbackBars and pullback

// === Plot confirmation marker ===
plotshape(greenConfirm, title="Pullback Continuation", location=location.belowbar, color=color.lime, style=shape.triangleup, size=size.small)
alertcondition(greenConfirm, title="Pullback Continuation Alert", message="🚀 {{ticker}} breakout pullback confirmed at {{close}}")

Declinazione di responsabilitĂ 

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.