如何在不遇到此特定错误的情况下绘制蜡烛?
我尝试了很多方法来解决该错误,但我似乎无法解决该错误。我正在尝试绘制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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
错误消息表明您正在将
color
传递给title
参数。plotcandle()
的第四个参数是title
而不是color
。如果你不想给它一个标题并为其分配颜色,你可以这样做:
The error message tells that you are passing
color
to thetitle
argument.The forth argument of
plotcandle()
istitle
and notcolor
.If you don't want to give it a title and assign a color to it, you can do it like this:
脚本如下
script as below