//version=5
indicator("Indicador OB - Reversão RSI/SR/MM", overlay=true)
// Parâmetros
rsiLength = input.int(14, title="Período RSI")
rsiOverbought = input.int(70, title="RSI Sobrecomprado")
rsiOversold = input.int(30, title="RSI Sobrevendido")
maLength = input.int(20, title="Período Média Móvel")
srRange = input.int(10, title="Candles para SR")
// Cálculos
rsi = ta.rsi(close, rsiLength)
ma = ta.sma(close, maLength)
// Suporte/Resistência (simples)
resistance = ta.highest(high, srRange)
support = ta.lowest(low, srRange)
inResistanceZone = high >= resistance * 0.995
inSupportZone = low <= support * 1.005
// Padrões de reversão
isBearishEngulfing = close[1] > open[1] and close < open and open >= close[1] and close <= open[1]
isBullishEngulfing = close[1] < open[1] and close > open and open <= close[1] and close >= open[1]
isPinBarDown = (high - close) > 2 * (close - low) and (close < open)
isPinBarUp = (close - low) > 2 * (high - close) and (close > open)
bearishSignal = inResistanceZone and (isBearishEngulfing or isPinBarDown) and rsi > rsiOverbought and close < ma
bullishSignal = inSupportZone and (isBullishEngulfing or isPinBarUp) and rsi < rsiOversold and close > ma
// Plotagem
plotshape(bearishSignal, title="Sinal PUT", location=location.abovebar, color=color.red, style=shape.labeldown, text="PUT")
plotshape(bullishSignal, title="Sinal CALL", location=location.belowbar, color=color.green, style=shape.labelup, text="CALL")
// Alertas
alertcondition(bearishSignal, title="Alerta PUT", message="Sinal PUT detectado: Resistência + Reversão + RSI + MM")
alertcondition(bullishSignal, title="Alerta CALL", message="Sinal CALL detectado: Suporte + Reversão + RSI + MM")
// Visual
plot(ma, title="Média Móvel", color=color.orange)
hline(rsiOverbought, "RSI Sobrecomprado", color=color.red)
hline(rsiOversold, "RSI Sobrevendido", color=color.green)
indicator("Indicador OB - Reversão RSI/SR/MM", overlay=true)
// Parâmetros
rsiLength = input.int(14, title="Período RSI")
rsiOverbought = input.int(70, title="RSI Sobrecomprado")
rsiOversold = input.int(30, title="RSI Sobrevendido")
maLength = input.int(20, title="Período Média Móvel")
srRange = input.int(10, title="Candles para SR")
// Cálculos
rsi = ta.rsi(close, rsiLength)
ma = ta.sma(close, maLength)
// Suporte/Resistência (simples)
resistance = ta.highest(high, srRange)
support = ta.lowest(low, srRange)
inResistanceZone = high >= resistance * 0.995
inSupportZone = low <= support * 1.005
// Padrões de reversão
isBearishEngulfing = close[1] > open[1] and close < open and open >= close[1] and close <= open[1]
isBullishEngulfing = close[1] < open[1] and close > open and open <= close[1] and close >= open[1]
isPinBarDown = (high - close) > 2 * (close - low) and (close < open)
isPinBarUp = (close - low) > 2 * (high - close) and (close > open)
bearishSignal = inResistanceZone and (isBearishEngulfing or isPinBarDown) and rsi > rsiOverbought and close < ma
bullishSignal = inSupportZone and (isBullishEngulfing or isPinBarUp) and rsi < rsiOversold and close > ma
// Plotagem
plotshape(bearishSignal, title="Sinal PUT", location=location.abovebar, color=color.red, style=shape.labeldown, text="PUT")
plotshape(bullishSignal, title="Sinal CALL", location=location.belowbar, color=color.green, style=shape.labelup, text="CALL")
// Alertas
alertcondition(bearishSignal, title="Alerta PUT", message="Sinal PUT detectado: Resistência + Reversão + RSI + MM")
alertcondition(bullishSignal, title="Alerta CALL", message="Sinal CALL detectado: Suporte + Reversão + RSI + MM")
// Visual
plot(ma, title="Média Móvel", color=color.orange)
hline(rsiOverbought, "RSI Sobrecomprado", color=color.red)
hline(rsiOversold, "RSI Sobrevendido", color=color.green)
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.
Aviso legal
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.