The basic logic is an indicator that tracks the high of the high bars in the specified range and the low of the low bars in the specified range.
I used two multipliers in order to go out of certain ranges and I tried to provide precision by subtracting this multiplier value from the lowest and highest values.
I set the steps of the multipliers to 0.01 so that it is easy to use on instruments that require finer tuning.
Because every instrument has its own dynamics. You should change the multiplier values according to the instrument dynamics.
For example, under Spot, these multiplier values work efficiently with a large multiplier such as 2.0. It is more efficient in the range of 0.1 - 0.2 in the stock market. I hope your transactions will be of some use in directional evaluation. Thanks.