繁体   English   中英

Pine 脚本无法返回行填充数组 Pine 脚本 v5 [错误报告]

[英]Pine script cannot return an array of linefills Pine script v5 [Bug report]

学习错误
内部服务器 pine 编译错误

这个基本示例抛出上面的异常。

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

test() =>
    foo = line.new(bar_index,  close, bar_index + 1,  close, xloc.bar_index, color = color.red)
    bar = line.new(bar_index, open, bar_index + 1, open, xloc.bar_index, color = color.green)

    lf = linefill.new(foo, bar, color.new(color.red, 80))
    
    array.from(lf) // we want to return n number of linefills 

lf = test()

这有什么特别的原因吗? 我想不出有什么理由可以免除简单数据类型作为数组返回。 这似乎又是一个松脚本错误。

截至今天( 2022-10-03 ),TradingView Pine 团队确认了该错误,并打开了修复它的任务。
目前唯一的解决方法是返回所有行填充的元组,如下所示:

test() =>  
    ...  
    [lf1, lf2, lf3]  

[linefill1, linefill2, linefill3] = test()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM