float []'的参数使用了类型,但是A系列float'预期

发布于 2025-01-25 00:05:55 字数 448 浏览 3 评论 0原文

我在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 技术交流群。

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

发布评论

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

评论(2

夏日落 2025-02-01 00:05:56

您可以通过简单地将数组调查到变量,例如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, ...)

暖伴 2025-02-01 00:05:56

您的函数返回kjfarray。然后,您正在尝试绘制不可能的数组。您的功能应返回数值。

Your function returns kjf which is an array. Then you are trying to plot an array which is not possible. Your function should return a numerical value.

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