如何在不遇到此特定错误的情况下绘制蜡烛?

发布于 2025-01-17 23:45:04 字数 494 浏览 0 评论 0原文

我尝试了很多方法来解决该错误,但我似乎无法解决该错误。我正在尝试绘制Heiken Ashi图表,但我遇到了这个错误“无法调用'plotcandle'用参数'title'='ccolor'。使用了“系列颜色”类型的参数,但期望“ const string” “,我是一个初学者,我不明白错误的错误。我该如何解决?

//@version=5
indicator("HA")

// Heiken Ashi

Open = (open[1] + close[1])/2
Close = (open + high + low + close)/4
High = math.max(high, math.max(open, high))
Low = math.min(low, math.max(open, high))

CColor = if Close > Open
    color.lime
else
    color.red

plotcandle(Open, High, Low, Close, CColor)

i tried a lot of methods to solve the error but i cannot seem to be able to solve it. i'm trying to plot a heiken ashi chart but i ran into this error "Cannot call 'plotcandle' with argument 'title'='CColor'. An argument of 'series color' type was used but a 'const string' is expected", i am a beginner i do not understand what the error insunate. how do i solve it?

//@version=5
indicator("HA")

// Heiken Ashi

Open = (open[1] + close[1])/2
Close = (open + high + low + close)/4
High = math.max(high, math.max(open, high))
Low = math.min(low, math.max(open, high))

CColor = if Close > Open
    color.lime
else
    color.red

plotcandle(Open, High, Low, Close, CColor)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

倚栏听风 2025-01-24 23:45:05

错误消息表明您正在将 color 传递给 title 参数。

plotcandle() 的第四个参数是 title 而不是 color

plotcandle(开盘价、最高价、最低价、收盘价、标题、颜色、灯芯颜色、可编辑、
show_last, bordercolor) → 无效

如果你不想给它一个标题并为其分配颜色,你可以这样做:

plotcandle(Open, High, Low, Close, color=CColor)

The error message tells that you are passing color to the title argument.

The forth argument of plotcandle() is title and not color.

plotcandle(open, high, low, close, title, color, wickcolor, editable,
show_last, bordercolor) → void

If you don't want to give it a title and assign a color to it, you can do it like this:

plotcandle(Open, High, Low, Close, color=CColor)
燃情 2025-01-24 23:45:05

脚本如下

//@version=5
indicator("HA")

// Heiken Ashi

Open = (open[1] + close[1])/2
Close = (open + high + low + close)/4
High = math.max(high, math.max(open, high))
Low = math.min(low, math.max(open, high))

CColor = Close > Open ? color.lime :color.red

plotcandle(Open, High, Low, Close, color = CColor)

script as below

//@version=5
indicator("HA")

// Heiken Ashi

Open = (open[1] + close[1])/2
Close = (open + high + low + close)/4
High = math.max(high, math.max(open, high))
Low = math.min(low, math.max(open, high))

CColor = Close > Open ? color.lime :color.red

plotcandle(Open, High, Low, Close, color = CColor)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文