//@version=5
indicator("Super Sinais de 1M", shorttitle="Sinais 1M+", overlay=true)
// Parâmetros configuráveis
emaLength = input(9, title="Período EMA")
rsiLength = input(14, title="Período RSI")
rsiOverbought = input(70, title="Nível de Sobrecompra")
rsiOversold = input(30, title="Nível de Sobrevenda")
macdFast = input(12, title="MACD Rápido")
macdSlow = input(26, title="MACD Lento")
macdSignal = input(9, title="MACD Sinal")
// Cálculos dos Indicadores
ema = ta.ema(close, emaLength)
rsi = ta.rsi(close, rsiLength)
[macdLine, signalLine, _] = ta.macd(close, macdFast, macdSlow, macdSignal)
// Regras de compra e venda
compra = ta.crossover(close, ema) and rsi < rsiOversold and macdLine > signalLine
venda = ta.crossunder(close, ema) and rsi > rsiOverbought and macdLine < signalLine
// Exibição no gráfico
plot(ema, color=color.blue, title="EMA")
plotshape(compra, style=shape.labelup, location=location.belowbar,
color=color.green, size=size.small, title="Compra")
plotshape(venda, style=shape.labeldown, location=location.abovebar,
color=color.red, size=size.small, title="Venda")
// Alertas
alertcondition(compra, title="Alerta de Compra", message="Sinal de compra
detectado!")
alertcondition(venda, title="Alerta de Venda", message="Sinal de venda detectado!")