HAPVIDA ON NM

Suporte - resistencia

34
//version=5
indicator("Suporte e Resistência Automático", overlay = true)

// Período de verificação
var int lookback = 20

// Calcula o suporte e resistência
highestHigh = ta.highest(high, lookback)
lowestLow = ta.lowest(low, lookback)

// Desenha linhas horizontais no gráfico
line.new(bar_index[lookback], highestHigh, bar_index, highestHigh, width=2, color=color.red)
line.new(bar_index[lookback], lowestLow, bar_index, lowestLow, width=2, color=color.green)

// Exibe os níveis no gráfico
plot(highestHigh, "Resistência", color=color.red, linewidth=2)
plot(lowestLow, "Suporte", color=color.green, linewidth=2)

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.