Bitcoin Bottom Detector: W Timeframe
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © MJShahsavar

//@version=5
indicator("Bitcoin Bottom Detector: W Timeframe", timeframe = "W")
a= ta.sma(close, 200)
b=close/a
c= math.log10(b) 
d= math.log10(c) 
h0=hline (0.3,  color=color.red, linewidth = 1)
h1=hline (-0.5,  color=color.red, linewidth = 1)
h2= hline (-1, color=color.red, linewidth = 1)
h3= hline (-1.3, color=color.black, linewidth = 1)
h4= hline (-2.7, color=color.blue, linewidth = 1)
h5= hline (-0.2, color=color.red, linewidth = 1)
h6= hline (-1.8, color=color.blue, linewidth = 1)

fill (h0, h5, color.red, transp = 80)
fill (h5, h1, color.orange, transp = 80)
fill (h6, h3, color.aqua, transp = 80)
fill (h6, h4, color.blue, transp = 80)
plot (d, color = color.blue, linewidth=1)