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)
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.