最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

pine script v5 Undeclared identifier 'plot' - Stack Overflow

programmeradmin3浏览0评论

good day this is part of my pine script

// Plot MACD components with conditional visibility
plot(macd_active ? macd_line : na, color=color.blue, title="MACD Line", linewidth=2)
plot(macd_active ? signal_line : na, color=color.orange, title="Signal Line", linewidth=2)
plot(macd_active ? histogram : na, style=plot.style_histogram, color=histogram >= 0 ? color.green : color.red, title="Histogram")
plot(0, color=color.gray, title="Zero Line", linewidth=1, style=plot.style_dashed)

I keek getting this error on the last 'plot' in the last string any advice Undeclared identifier 'plot'

good day this is part of my pine script

// Plot MACD components with conditional visibility
plot(macd_active ? macd_line : na, color=color.blue, title="MACD Line", linewidth=2)
plot(macd_active ? signal_line : na, color=color.orange, title="Signal Line", linewidth=2)
plot(macd_active ? histogram : na, style=plot.style_histogram, color=histogram >= 0 ? color.green : color.red, title="Histogram")
plot(0, color=color.gray, title="Zero Line", linewidth=1, style=plot.style_dashed)

I keek getting this error on the last 'plot' in the last string any advice Undeclared identifier 'plot'

Share Improve this question edited Mar 16 at 20:19 jam j 6281 gold badge2 silver badges20 bronze badges asked Mar 15 at 19:31 francois de kokerfrancois de koker 231 silver badge5 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 1

plot() does not have a style called plot.style_dashed.

Possible values are: plot.style_line, plot.style_stepline, plot.style_stepline_diamond, plot.style_histogram, plot.style_cross, plot.style_area, plot.style_columns, plot.style_circles, plot.style_linebr, plot.style_areabr, plot.style_steplinebr.

If you want a dashed line, you can use hline() instead.

hline(0, "Zero Line", color.gray, hline.style_dashed, 1)

发布评论

评论列表(0)

  1. 暂无评论