OPEN-SOURCE SCRIPT
MC² Daily Candidates (v1.0 SAFE)

// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at mozilla.org/MPL/2.0/
// © mason_fibkins
//version=5
indicator("MC² Daily Candidates (v1.0 SAFE)", overlay=true)
// ──────────────────────────────────────────
// INTERNAL DAILY DATA (NO TIMEFRAME ARGUMENT)
// ──────────────────────────────────────────
getDaily(_src) =>
request.security(syminfo.tickerid, "D", _src)
// Daily values
d_close = getDaily(close)
d_open = getDaily(open)
d_high = getDaily(high)
d_low = getDaily(low)
d_vol = getDaily(volume)
// ──────────────────────────────────────────
// Parameters
// ──────────────────────────────────────────
lookbackVol = input.int(10, "Vol Lookback (days)")
atrLength = input.int(14, "ATR Length")
emaLen = input.int(20, "EMA Length")
smaLen = input.int(50, "SMA Length")
// ──────────────────────────────────────────
// Core Calculations (DAILY)
// ──────────────────────────────────────────
// Relative Volume
relVol = d_vol / request.security(syminfo.tickerid, "D", ta.sma(volume, lookbackVol))
// Momentum — last 2 daily bullish candles
twoGreen = (d_close > d_open) and (request.security(syminfo.tickerid, "D", close[1]) > request.security(syminfo.tickerid, "D", open[1]))
// Trend filters
emaTrend = d_close > request.security(syminfo.tickerid, "D", ta.ema(close, emaLen))
smaTrend = d_close > request.security(syminfo.tickerid, "D", ta.sma(close, smaLen))
// ATR Expansion
d_atr = request.security(syminfo.tickerid, "D", ta.atr(atrLength))
atrExpand = d_atr > request.security(syminfo.tickerid, "D", ta.atr(atrLength))[1]
// Strong Close
dayRange = d_high - d_low
closePos = dayRange > 0 ? (d_close - d_low) / dayRange : 0.5
strongClose = closePos > 0.70
// MASTER CONDITION
candidate = relVol > 2.0 and twoGreen and emaTrend and smaTrend and atrExpand and strongClose
// ──────────────────────────────────────────
// PLOT — GREEN CIRCLE BELOW DAILY BARS
// ──────────────────────────────────────────
plotshape(candidate, title="Daily Candidate", style=shape.circle, size=size.large, color=color.new(color.green, 0), location=location.belowbar, text="MC²")
// ──────────────────────────────────────────
// END
// ──────────────────────────────────────────
plot(candidate ? 1 : 0, title="MC2_Signal", display=display.none)
// © mason_fibkins
//version=5
indicator("MC² Daily Candidates (v1.0 SAFE)", overlay=true)
// ──────────────────────────────────────────
// INTERNAL DAILY DATA (NO TIMEFRAME ARGUMENT)
// ──────────────────────────────────────────
getDaily(_src) =>
request.security(syminfo.tickerid, "D", _src)
// Daily values
d_close = getDaily(close)
d_open = getDaily(open)
d_high = getDaily(high)
d_low = getDaily(low)
d_vol = getDaily(volume)
// ──────────────────────────────────────────
// Parameters
// ──────────────────────────────────────────
lookbackVol = input.int(10, "Vol Lookback (days)")
atrLength = input.int(14, "ATR Length")
emaLen = input.int(20, "EMA Length")
smaLen = input.int(50, "SMA Length")
// ──────────────────────────────────────────
// Core Calculations (DAILY)
// ──────────────────────────────────────────
// Relative Volume
relVol = d_vol / request.security(syminfo.tickerid, "D", ta.sma(volume, lookbackVol))
// Momentum — last 2 daily bullish candles
twoGreen = (d_close > d_open) and (request.security(syminfo.tickerid, "D", close[1]) > request.security(syminfo.tickerid, "D", open[1]))
// Trend filters
emaTrend = d_close > request.security(syminfo.tickerid, "D", ta.ema(close, emaLen))
smaTrend = d_close > request.security(syminfo.tickerid, "D", ta.sma(close, smaLen))
// ATR Expansion
d_atr = request.security(syminfo.tickerid, "D", ta.atr(atrLength))
atrExpand = d_atr > request.security(syminfo.tickerid, "D", ta.atr(atrLength))[1]
// Strong Close
dayRange = d_high - d_low
closePos = dayRange > 0 ? (d_close - d_low) / dayRange : 0.5
strongClose = closePos > 0.70
// MASTER CONDITION
candidate = relVol > 2.0 and twoGreen and emaTrend and smaTrend and atrExpand and strongClose
// ──────────────────────────────────────────
// PLOT — GREEN CIRCLE BELOW DAILY BARS
// ──────────────────────────────────────────
plotshape(candidate, title="Daily Candidate", style=shape.circle, size=size.large, color=color.new(color.green, 0), location=location.belowbar, text="MC²")
// ──────────────────────────────────────────
// END
// ──────────────────────────────────────────
plot(candidate ? 1 : 0, title="MC2_Signal", display=display.none)
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.