OPEN-SOURCE SCRIPT

MC2 Daily Screener

29
//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}})")

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.