I would like to introduce you support&resistance script. The benchmark is the Upper applied on with a look-back setting of 233 and a displacement of 3 standard deviations.
(There’s nothing magical about the setting of 233, but you should use a long-term parameter so that you get a stable . Short-term parameters tend to produce erratic bands.)
If a price bar shows that exceeds this benchmark, we will zoom in and use it as potential support or in our price analysis. if there is only one candle that will crossover and cross under than only high and lo of that candle is counting. If there are more consecutive bars that are above upper than the range high and lo is calculated from high and lows of that candle
As you can see on the image high and low is only rendered when crossover and cross under
I hope you will enjoy it
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 a publication is governed by House Rules. You can favorite it to use it on a chart.