How to display/hide a hline using input from user?

爱⌒轻易说出口 提交于 2021-02-11 14:39:40

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!