OPEN-SOURCE SCRIPT

MC2 Daily Screener

31
//version=5
indicator("MC2 Daily Screener", overlay = false)

// 🔹 Inputs
relVolThresh = input.float(2.0, "RelVol Threshold")
rangeMult = input.float(2.0, "Range Multiplier")
lookback = input.int(20, "Lookback Bars")

// 🔹 Calculations
relVol = volume / ta.sma(volume, lookback)
rangeNow = high - low
rangeAvg = ta.sma(rangeNow, lookback)

// 🔥 MC² condition
mc2 = relVol > relVolThresh and rangeNow > rangeAvg * rangeMult

// 🔹 Convert to numeric (1 = signal, 0 = none)
mc2Value = mc2 ? 1.0 : 0.0

// This plot is what Pine Screener will use as a column/filter
plot(mc2Value, title = "MC2", style = plot.style_columns)

// Optional: alert so you can also use alertconditions in the Screener
alertcondition(mc2, title = "MC2 Signal", message = "MC2 signal on {{ticker}} ({{interval}})")

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.