簡體   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