问题
I would like to allow users of my script to display or hide some dashed horizontal lines.
I can't find the way to do this using hline.
I've managed to do it using plot, but there is no dashed line format for plot. (I know there is a trick to plot dash lines: How to plot a dashed line on pine script V4?, but the end result doesn't look like the original hline dash line.)
回答1:
//@version=4
study("")
showHline = input(true)
hline(50, color = showHline ? color.blue : #00000000)
plot(na)
来源:https://stackoverflow.com/questions/58859355/how-to-display-hide-a-hline-using-input-from-user