Fractal Dimension
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © IvarssonAnalytics

//@version=5
indicator("Fractal Dimension")

ri = math.log(close/close[1])
n = 65
Rin = math.log(close/close[n])
Nin = (math.sum(math.abs(ri),n))/(math.abs(Rin)/n)
Din = math.log(Nin)/math.log(n)
plot(Din)
plot(1.25)
