Im trying to create a switch a On/off switch for Line.new but im not sure how to go about it
ShowAsiaRange = input.bool(true,'Show Asia Range', group= M1)
tl = line.new(LineFromDate, rth_low, LineToDate, rth_low, xloc=xloc.bar_time, color=line_color, style=upperlower_line_style, width=sessionLineWidth)
line.delete(tl[1])
th = line.new(LineFromDate, rth_high, LineToDate, rth_high, xloc=xloc.bar_time, color=line_color, style=upperlower_line_style, width=sessionLineWidth)
line.delete(th[1])
tm = line.new(LineFromDate, rth_mid, LineToDate, rth_mid, xloc=xloc.bar_time, color=user_midline_color, style=middle_line_style, width=Width)
line.delete(tm[1])
I have tried the if function but to no avail so im stuck here, Im also new to pinescript so I am searching for help