Rate Of Change [Hyperbolic]
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © akikostas

//@version=5
indicator(title="Rate Of Change [Log] ", shorttitle="ROC-L", format=format.price, precision=2, timeframe="", timeframe_gaps=true)
length = input.int(9, minval=1)
source = input(close, "Source")
exotic = input.bool(false, title = "Exotic Calculations")

logarithmic(src)=> math.sign(src) * math.log(math.abs(src) + 1)

roc = 100 * (source - source[length])/source[length]
if (exotic)
    roc := logarithmic(source) - logarithmic(source[length])
    
plot(roc, color=#2962FF, title="ROC")
hline(0, color=#787B86, title="Zero Line")