Lankou Shad helper
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © lankou

//@version=5
indicator('Lankou Shad helper', overlay=true)


input_price = input.price(0, title="price, 0 for AUTO mode")

cur_price = close
if (input_price != 0)
    cur_price := input_price
    
//hline(price, title, color, linestyle, linewidth, editable) → hline
//hline(price=cur_price, title="start calc", color=color.rgb(0, 0, 255), linestyle=hline.style_solid, linewidth=1)

if (input_price != 0)
    var line _newLine = line.new(bar_index[1], cur_price, bar_index, cur_price, extend=extend.right)
    line.set_x2(_newLine, x=bar_index)
    line.set_style(id=_newLine, style=line.style_solid)
    line.set_width(id=_newLine, width=5)
    line.set_color(id=_newLine, color=color.rgb(50, 50, 255, 10))

plot(cur_price / 4, trackprice=true, offset=-9999, color=color.rgb(205, 50, 100), title="/4")
plot(cur_price / 2, trackprice=true, offset=-9999, color=color.rgb(205, 50, 100), title="/2")
plot(2 * cur_price, trackprice=true, offset=-9999, title="x2")
plot(4 * cur_price, trackprice=true, offset=-9999, title="x4")
plot(8 * cur_price, trackprice=true, offset=-9999, title="x8")
//plot(16 * close, trackprice=true, offset=-9999, title="x16")



if timeframe.ismonthly or timeframe.isdaily or timeframe.isweekly
    if barstate.islast and syminfo.basecurrency != "BTC"
        dt = time - time[1]
        label.new(time + 4*dt, cur_price / 2, xloc=xloc.bar_time, text="/2", color=color.rgb(205, 50, 100))
        label.new(time + 12*dt, cur_price / 4, xloc=xloc.bar_time, text="/4", color=color.rgb(205, 50, 100))
        label.new(time + 3*dt, 2 * cur_price, xloc=xloc.bar_time, text="x2")
        label.new(time + 3*dt, 4 * cur_price, xloc=xloc.bar_time, text="x4")
        //label.new(time + 3*dt, 8 * close, xloc=xloc.bar_time, text="x8")
        //label.new(time + 3*dt, 16 * close, xloc=xloc.bar_time, text="x16")
    
