This is a port of an indicator I wrote for MT4 several years ago. At the time it was the only thing available that could accurately plot support/resistance lines in an automated way. Now there are many that do similar things, but I still think this is one of the cleanest and most straightforward ones to use.
Parameters:
Signal Bars - Number of candles to look back for the high and low.
Peak Bar - Which of the candles must be the high or low to be used as the support or resistance level.
Notes:
Setting Peak Bar to 3 gives the most accurate results. Lower values will give false signals and higher values might be late in generating a useful signal.
Adjust your Signal Bars according to the timeframe you use. For example, 20 days worth of candles on 1-hour or higher charts will produce strong entry signals.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in publications is governed by House rules. You can favorite it to use it on a chart.
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.