如何使用用户输入显示/隐藏一条线? [英] How to display/hide a hline using input from user?

查看:63
本文介绍了如何使用用户输入显示/隐藏一条线?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想允许我的脚本用户显示或隐藏一些水平虚线.

I would like to allow users of my script to display or hide some dashed horizontal lines.

我找不到使用 hline 执行此操作的方法.

I can't find the way to do this using hline.

我已经设法使用绘图来完成它,但是绘图没有虚线格式.(我知道绘制虚线有一个技巧:如何在pine script V4上绘制虚线?,但最终结果看起来不像原来的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.)

推荐答案

//@version=4
study("")
showHline = input(true)
hline(50, color = showHline ? color.blue : #00000000)
plot(na)

这篇关于如何使用用户输入显示/隐藏一条线?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆