OPEN-SOURCE SCRIPT
MC² Tight Compression Screener v1.0

//version=5
indicator("MC² Tight Compression Screener v1.0", overlay=false)
// ————————————————
// Inputs
// ————————————————
lookbackHigh = input.int(50, "Near High Lookback")
atrLength = input.int(14, "ATR Length")
volLength = input.int(20, "Volume SMA Length")
thresholdNear = input.float(0.97, "Near Break % (0.97 = within 3%)")
// ————————————————
// Conditions
// ————————————————
// ATR Compression: shrinking 3 days in a row
atr = ta.atr(atrLength)
atrCompression = atr < atr[1] and atr[1] < atr[2] and atr[2] < atr[3]
// Price is near recent highs
recentHigh = ta.highest(high, lookbackHigh)
nearBreak = close > recentHigh * thresholdNear
// Volume not dead (preferably building)
volAvg = ta.sma(volume, volLength)
volOK = volume > volAvg
// Final signal (binary)
signal = atrCompression and nearBreak and volOK
// ————————————————
// Plot (for Pine Screener)
// ————————————————
plot(signal ? 1 : 0, title="MC2 Compression Signal")
indicator("MC² Tight Compression Screener v1.0", overlay=false)
// ————————————————
// Inputs
// ————————————————
lookbackHigh = input.int(50, "Near High Lookback")
atrLength = input.int(14, "ATR Length")
volLength = input.int(20, "Volume SMA Length")
thresholdNear = input.float(0.97, "Near Break % (0.97 = within 3%)")
// ————————————————
// Conditions
// ————————————————
// ATR Compression: shrinking 3 days in a row
atr = ta.atr(atrLength)
atrCompression = atr < atr[1] and atr[1] < atr[2] and atr[2] < atr[3]
// Price is near recent highs
recentHigh = ta.highest(high, lookbackHigh)
nearBreak = close > recentHigh * thresholdNear
// Volume not dead (preferably building)
volAvg = ta.sma(volume, volLength)
volOK = volume > volAvg
// Final signal (binary)
signal = atrCompression and nearBreak and volOK
// ————————————————
// Plot (for Pine Screener)
// ————————————————
plot(signal ? 1 : 0, title="MC2 Compression Signal")
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.
Script de código abierto
Fiel al espíritu de TradingView, el creador de este script lo ha convertido en código abierto, para que los traders puedan revisar y verificar su funcionalidad. ¡Enhorabuena al autor! Aunque puede utilizarlo de forma gratuita, recuerde que la republicación del código está sujeta a nuestras Normas internas.
Exención de responsabilidad
La información y las publicaciones no constituyen, ni deben considerarse como asesoramiento o recomendaciones financieras, de inversión, de trading o de otro tipo proporcionadas o respaldadas por TradingView. Más información en Condiciones de uso.