OPEN-SOURCE SCRIPT
MC² Pullback Screener v1.01

//version=5
indicator("MC² Pullback Screener v1.01", overlay=false)
//----------------------------------------------------
// 🔹 PARAMETERS
//----------------------------------------------------
lenTrend = input.int(20, "SMA Trend Length")
relVolLookback = input.int(10, "Relative Volume Lookback")
minRelVol = input.float(0.7, "Min Relative Volume on Pullback")
maxSpikeVol = input.float(3.5, "Max Spike Vol (Reject News Bars)")
pullbackBars = input.int(3, "Pullback Lookback Bars")
//----------------------------------------------------
// 🔹 DATA
//----------------------------------------------------
// Moving averages for trend direction
sma20 = ta.sma(close, lenTrend)
sma50 = ta.sma(close, 50)
// Relative Volume
volAvg = ta.sma(volume, relVolLookback)
relVol = volume / volAvg
// Trend condition
uptrend = close > sma20 and sma20 > sma50
//----------------------------------------------------
// 🔹 BREAKOUT + PULLBACK LOGIC
//----------------------------------------------------
// Recent breakout reference
recentHigh = ta.highest(close, 10)
isBreakout = close > recentHigh[1]
// Pullback logic
nearSupport = close > recentHigh[1] * 0.98 and close < recentHigh[1] * 1.02
lowVolPullback = relVol < minRelVol
// Reject single-bar news spike
rejectSpike = relVol > maxSpikeVol
//----------------------------------------------------
// 🔹 ENTRY SIGNAL
//----------------------------------------------------
pullbackSignal = uptrend and lowVolPullback and nearSupport and not rejectSpike
//----------------------------------------------------
// 🔹 SCREENER OUTPUT
//----------------------------------------------------
// Pine Screener expects a plot output
plot(pullbackSignal ? 1 : 0, title="MC² Pullback Signal", style=plot.style_columns, color=pullbackSignal ? color.green : color.black)
indicator("MC² Pullback Screener v1.01", overlay=false)
//----------------------------------------------------
// 🔹 PARAMETERS
//----------------------------------------------------
lenTrend = input.int(20, "SMA Trend Length")
relVolLookback = input.int(10, "Relative Volume Lookback")
minRelVol = input.float(0.7, "Min Relative Volume on Pullback")
maxSpikeVol = input.float(3.5, "Max Spike Vol (Reject News Bars)")
pullbackBars = input.int(3, "Pullback Lookback Bars")
//----------------------------------------------------
// 🔹 DATA
//----------------------------------------------------
// Moving averages for trend direction
sma20 = ta.sma(close, lenTrend)
sma50 = ta.sma(close, 50)
// Relative Volume
volAvg = ta.sma(volume, relVolLookback)
relVol = volume / volAvg
// Trend condition
uptrend = close > sma20 and sma20 > sma50
//----------------------------------------------------
// 🔹 BREAKOUT + PULLBACK LOGIC
//----------------------------------------------------
// Recent breakout reference
recentHigh = ta.highest(close, 10)
isBreakout = close > recentHigh[1]
// Pullback logic
nearSupport = close > recentHigh[1] * 0.98 and close < recentHigh[1] * 1.02
lowVolPullback = relVol < minRelVol
// Reject single-bar news spike
rejectSpike = relVol > maxSpikeVol
//----------------------------------------------------
// 🔹 ENTRY SIGNAL
//----------------------------------------------------
pullbackSignal = uptrend and lowVolPullback and nearSupport and not rejectSpike
//----------------------------------------------------
// 🔹 SCREENER OUTPUT
//----------------------------------------------------
// Pine Screener expects a plot output
plot(pullbackSignal ? 1 : 0, title="MC² Pullback Signal", style=plot.style_columns, color=pullbackSignal ? color.green : color.black)
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
Aviso legal
As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.