float []'的参数使用了类型,但是A系列float'预期
我在pinescript
中写了此代码:
kijen_forw(period ) =>
kjf = array.new_float(20)
for i = 1 to period
array.set(kjf,i,donchian(kijensenPeriods-i))
kjf
kjf_draw = kijen_forw(10)
plot(kjf_draw , color=color.new(color.yellow,00) , linewidth=2
,offset=10 , show_last=10 ,title="Kijensen Forward" )
但是我得到了这个错误: 无法用参数'系列'='kjf_draw'调用“绘图”。使用了“ float []'类型的论点,但预计“系列float”
I wrote this code in pinescript
:
kijen_forw(period ) =>
kjf = array.new_float(20)
for i = 1 to period
array.set(kjf,i,donchian(kijensenPeriods-i))
kjf
kjf_draw = kijen_forw(10)
plot(kjf_draw , color=color.new(color.yellow,00) , linewidth=2
,offset=10 , show_last=10 ,title="Kijensen Forward" )
But I get this error :
Cannot call 'plot' with argument 'series'='kjf_draw'. An argument of 'float[]' type was used but a 'series float' is expected
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过简单地将数组调查到变量,例如arrayex_var = array.get(kjf,len)来轻松修复此操作。
情节(arrayex_var,...)
You can fix this easily by simply assinging an array to a variable, for example, arrayex_var = array.get(kjf, len)
plot(arrayex_var, ...)
您的函数返回
kjf
是array
。然后,您正在尝试绘制不可能的数组。您的功能应返回数值。Your function returns
kjf
which is anarray
. Then you are trying to plot an array which is not possible. Your function should return a numerical value.