//@version=5
indicator("Zé Comprar / Zé Vender Pro", overlay=true)
// Parâmetros
fastLen = input.int(8, title="Média Rápida")
slowLen = input.int(21, title="Média Lenta")
volMultiplier = input.float(1.5, title="Multiplicador de Volume")
// Médias móveis
fastMA = ta.ema(close, fastLen)
slowMA = ta.ema(close, slowLen)
// Volume médio
volMa = ta.sma(volume, 20)
// Condições de compra e venda
buyCond = ta.crossover(fastMA, slowMA) and volume > volMa * volMultiplier
sellCond = ta.crossunder(fastMA, slowMA) and volume > volMa * volMultiplier
// Plotando as médias
plot(fastMA, color=color.green, title="Média Rápida")
plot(slowMA, color=color.red, title="Média Lenta")
// Sinais de compra e venda
plotshape(buyCond, title="Zé Comprar", location=location.belowbar,
color=color.lime, style=shape.labelup, text="Zé
Comprar")
plotshape(sellCond, title="Zé Vender", location=location.abovebar, color=color.red,
style=shape.labeldown, text="Zé
Vender")
// Alertas
alertcondition(buyCond, title="Alerta Zé Comprar", message="Zé está comprando com
volume!")
alertcondition(sellCond, title="Alerta Zé Vender", message="Zé está vendendo com
volume!")