I’m creating a TradingView indicator and currently I have to manually identify and draw support and resistance levels on the chart.
I want my Pine Script to detect important price levels automatically and plot them on the chart. What is a simple way to identify swing highs and swing lows and use them as resistance and support?