输入时间后,如何在接下来的几个条中添加垂直线? (pinescript)
我已经尝试了此代码,但它不起作用。我试图在输入后制作垂直线10条。
//@version=5
indicator("Mulitple bars after time input", overlay = true)
// Date/Time Input
inp_time1 = input.time(timestamp("21 Mar 2022 00:00 +0000"), "Date", confirm = true)
var barCount1 = 0
barCount1 := inp_time1 ? 0 : barCount1 + 1
if barCount1 == 10
line.new(bar_index, open, bar_index, close, extend = extend.both, color = color.green)
I have tried this code, but it doesn't work. I tried to make the vertical line 10 bars after the input.time
//@version=5
indicator("Mulitple bars after time input", overlay = true)
// Date/Time Input
inp_time1 = input.time(timestamp("21 Mar 2022 00:00 +0000"), "Date", confirm = true)
var barCount1 = 0
barCount1 := inp_time1 ? 0 : barCount1 + 1
if barCount1 == 10
line.new(bar_index, open, bar_index, close, extend = extend.both, color = color.green)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
删除了计数器并添加了输入时间检查,您可以将值直接添加到BAR_INDEX中,以使其向右绘制,例如:
Removed the counter and added an input time check instead, you can directly add the value to the bar_index to make it plot to the right, with input for example: