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