情节线从开放到关闭
目前有一些代码绘制每天开放的线路。该图从正确的值开始,但是我在值之间得到了对角线。我想整天绘制一条水平线,因此,这将是开放式上方的水平线,从初始值持续到关闭,直到基于新的Open重置新值。
我可以看到Pine脚本参考手册上的此选择,因此我真的不确定从哪里开始。我知道这是可能的,因为我已经看到了其他指标的类似内容,因此我可能正在搜索错误的事情。
任何帮助都非常感谢。
下面是我当前的代码
indicator("Jack AVG Hi Low", "Jack AVG HL", timeframe="D")
//user inputs
high_avg_period = input(12, "High AVG Period")
//calculations
avg_high = ta.sma(high-open, high_avg_period)
//plot
plot(close+avg_high, title='AVG High', color=color.green, linewidth=2, style=plot.style_stepline)
下面的屏幕截图,是所有三个图的屏幕截图,因为它们在每天打开的时间之间都具有对角线。
下面也是每天绘制开放式绘制的屏幕截图,因为我想要每天绘制的线条。不幸的是,代码被隐藏了。
Currently have some code plotting a line above the open of each day. This plot starts at the correct value but I then get a diagonal line between values. I'm wanting to plot a horizontal line for the whole day instead, so this would be a horizontal line above the open from the initial value continuing until the close before resetting at the new value based on the new open.
There is no option for this on pine script reference manual that i can see so I'm really not sure where to start. I know its possible as I have seen similar things for other indicators so I'm potentially searching the wrong things.
Any help is very much appreciated.
Below is my current code
indicator("Jack AVG Hi Low", "Jack AVG HL", timeframe="D")
//user inputs
high_avg_period = input(12, "High AVG Period")
//calculations
avg_high = ta.sma(high-open, high_avg_period)
//plot
plot(close+avg_high, title='AVG High', color=color.green, linewidth=2, style=plot.style_stepline)
Below is a screenshot of all three plots as they currently are with diagonal lines between each days open.
Below is also a screenshot of the open plotted each day as I would like my lines plotted each day. Unfortunately the code is hidden.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论