关闭编译器警告消息



脚本保存成功后,我收到来自pinescript的警告消息。有没有办法关闭这些烦人的消息。

The function 'perc_change' should be called on each calculation for consistency. It is recommended to extract the call from this scope.
The `transp` argument will be deprecated soon. We recommend using color.new() or color.rgb() functions to specify the transparency of the plots instead.

当你知道自己在做什么时,关闭一些编译器警告确实很有用。然而,截至本文撰写之时,这还不可用。作为参考,pine-script已经支持带有注释的特殊编译器注释;参见文档。TradingView人员应该很容易实现这样的警告功能。

话虽如此,除非你很清楚自己在做什么,否则你不应该忽视这样一个警告:

The function 'foo' should be called on each calculation for consistency. It is recommended to extract the call from the ternary operator or from the scope

这是因为pine-script中的功能块保留了自己独立的历史上下文。对于某些类型的函数,不在每个小节中运行它们会导致奇怪和错误的结果;参见文档。

最新更新