Pine script Pine脚本无法调用';安全';争论不休

Pine script Pine脚本无法调用';安全';争论不休,pine-script,Pine Script,yr=tostring(年份,NSE:X) 第3卷股票代码=股票代码+年 vol3=安全性(vol3\u股票代码、timeframe.period、volume、lookahead=barmerge.lookahead\u on) 错误 无法使用参数调用“安全性”(series[string],string,series[float],lookahead=const bool);可用重载:安全性(string,string,series[float],const bool,const bool,

yr=tostring(年份,NSE:X)

第3卷股票代码=股票代码+年

vol3=安全性(vol3\u股票代码、timeframe.period、volume、lookahead=barmerge.lookahead\u on)

错误


无法使用参数调用“安全性”(series[string],string,series[float],lookahead=const bool);可用重载:安全性(string,string,series[float],const bool,const bool,string)=>series[float];安全性(string,string,series[integer],const bool,const bool,string)=>series[integer];安全性(字符串,字符串,系列[bool],常量bool,常量bool,字符串)=>系列[bool];安全性(字符串、字符串、系列[颜色]、常量布尔、常量布尔、字符串)=>系列[颜色];安全性(string,string,const bool,const bool,string)=>

安全性的符号参数接受常量字符串

yr = tostring(year,"NSE:X####")
在这种情况下,
yr
变量将返回
NSE:X2020
字符串

而您正试图从pine版本3添加当前股票代码的字符串。在安全参数中,您将pine版本4内置变量定义为参数(
timeframe.period
)-您不能混合来自不同版本的内置变量,必须选择要在哪个版本的pine上编写脚本。在脚本开头定义它-
/@version=4

版本4中当前的ticker字符串是
syminfo.ticker
(在版本3中只是
ticker

当您将使用
vol3\u ticker=syminfo.ticker+yr
构建字符串时,在将其转发到安全功能之前,请确保它存在于tradingview的数据源中