The idea is to the range of the last day, multiplying it by 0.38 and 0.62 and projecting them from the opening of the current day, both in the up and down directions.
I tried to make it better with following fixes.
– Changed the range / amplitude to actually use the previous instead of the current candle >> amplitude = high - low
– Added the ability to set a custom number for the calculation of the expansion. The default is math.rphi which is ~0.618.
– Added a custom resolution entry field so you can for example enter 720 for half a day.
– You now can choose wheter it should use the daily open or the last days hl2 ( (high+low) / 2 ) for the calculation of the range expansion.
– Connecting lines for the ranges can now be turned off
– The offset selection for HL2/HLC3 mode and amplitude (range) are now completely customizable to your likes.
Center mode seems to be interesting for crypto assets.
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.