OPEN-SOURCE SCRIPT

Gracias mi Dios Sammy Indicador

107
QQQ //version=5
indicator("Gracias mi Dios Sammy Indicador", overlay=true, max_labels_count=500)

// Cálculo de condiciones de velas
isBullish = close > open
isBearish = close < open
prevBullish = close[1] > open[1]
prevBearish = close[1] < open[1]

// Patrón Alcista (A): vela verde envuelve completamente a la roja previa
bullishEngulfing = isBullish and prevBearish and close > open[1] and open < close[1]

// Patrón Bajista (B): vela roja envuelve completamente a la verde previa
bearishEngulfing = isBearish and prevBullish and close < open[1] and open > close[1]

// Marcar con “A” (alcista) y “B” (bajista)
plotshape(bullishEngulfing, title="Alcista", style=shape.labelup, color=color.green, text="A", size=size.tiny, location=location.belowbar, textcolor=color.white)
plotshape(bearishEngulfing, title="Bajista", style=shape.labeldown, color=color.red, text="B", size=size.tiny, location=location.abovebar, textcolor=color.white)

// Alertas
alertcondition(bullishEngulfing, title="Alerta Alcista", message="Patrón Alcista (A) detectado")
alertcondition(bearishEngulfing, title="Alerta Bajista", message="Patrón Bajista (B) detectado")

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.