范围Pine脚本中的最高高
我正在尝试标记和更改该范围内最高条的颜色。取而代之的是,它用颜色绘制所有条形图,并且不会在最高条上绘制标签,而是在最后一个栏上绘制标签?
//@version=5
indicator(title='Label', overlay=true)
highestHigh = ta.highest(high, 20)
lowestLows = ta.lowest(low, 20)
PmeU = if highestHigh
label.new(bar_index, na, "Highest pirce was: " + str.tostring(highestHigh), color=color.green, textcolor=color.black, style=label.style_label_down, yloc=yloc.abovebar)
label.delete(PmeU[1])
barcolor(highestHigh ? color.blue : na)
I am trying to label and change the color of the highest bar in the range. Instead, it paints all bars with the color and does not plot the label on the highest bar but on the last bar?
//@version=5
indicator(title='Label', overlay=true)
highestHigh = ta.highest(high, 20)
lowestLows = ta.lowest(low, 20)
PmeU = if highestHigh
label.new(bar_index, na, "Highest pirce was: " + str.tostring(highestHigh), color=color.green, textcolor=color.black, style=label.style_label_down, yloc=yloc.abovebar)
label.delete(PmeU[1])
barcolor(highestHigh ? color.blue : na)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
ta.highest()
返回回溯期内的最高价格。如果当前high
是最高的,则不会返回。您需要对此进行额外检查。说到
标签
的问题,这是因为你总是删除前一个标签。我认为您不想删除案例中的任何标签。ta.highest()
returns the highest price within the lookback period. It does not return if the currenthigh
is the highest. You need an additional check for that.Coming to the issue with the
label
, it is because you always delete the previous one. I don't think you want to delete any label in your case.