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)
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。