OPEN-SOURCE SCRIPT
Gracias mi Dios Sammy Indicador

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")
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
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.