Pine:如何对特定图表使用 label.new(绘制图表和下面的指标时)
我想在价格图表上而不是在 CCI 图表上绘制最后一个柱的指数(“5830”,请参见下面的屏幕截图)。
到目前为止,这是我的代码:
//@version=5
indicator("Mon script", overlay=false)
// CCI
cciSource = input.source(close, "Source CCI")
cci=ta.cci(close, 20)
plot(bar_index % 2 ? na: 100, color=color.gray, style=plot.style_linebr)
plot(bar_index % 2 ? na: -100, color=color.gray, style=plot.style_linebr)
plot(cci, title="CCI",color=color.fuchsia)
if (barstate.islast)
label.new(bar_index, open, str.tostring(bar_index, format.mintick), yloc = yloc.belowbar, style = label.style_none, textcolor = color.black, size = size.normal)
知道如何执行此操作吗?
此致
I would like to plot the index of the last bar ("5830", see screenshot below) on the prices chart instead of on the CCI chart.
Here is my code so far:
//@version=5
indicator("Mon script", overlay=false)
// CCI
cciSource = input.source(close, "Source CCI")
cci=ta.cci(close, 20)
plot(bar_index % 2 ? na: 100, color=color.gray, style=plot.style_linebr)
plot(bar_index % 2 ? na: -100, color=color.gray, style=plot.style_linebr)
plot(cci, title="CCI",color=color.fuchsia)
if (barstate.islast)
label.new(bar_index, open, str.tostring(bar_index, format.mintick), yloc = yloc.belowbar, style = label.style_none, textcolor = color.black, size = size.normal)
Any idea on how to do this ?
Best regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您已经使用了标签,因此将指标属性更改为
overlay=true
另外,您可以将其设置为表格
You already used label, so change the indicator properties to
overlay=true
Also, you can make it as table