为什么在版本 5 中找不到松树脚本的"ta.sqrt"?



我没有找到函数ta.sqrt…我不明白为什么?我尝试导入ta,但不太工作

//@version=5
//@library=ta
indicator("Trend Extractor", overlay=false)
src=input(close, title="Source")
smooth = input.int(1, title="Smoothing", minval=1)
length = input.int(50, title="Lookback", minval=1)
offset = input.float(0.85, title= "ALMA Offset", step=0.01)
sigma = input.float(6, title= "ALMA Sigma", minval=0)
bmult = input.float(1.0, "Band Multiplier")
cblen = input.bool(false, "Custom Band Length ? (Else same as Lookback)") 
blen = input.int(20, "Custom Band Length")
highlight=input.bool(true)
fill=input.bool(true)
barcol=input.bool(false, "Bar Color")
pch = ta.change(src, smooth)/src * 100
avpch = ta.alma(pch, length, offset, sigma)
blength = cblen ? blen : length
rms = bmult*ta.sqrt(ta.sma(avpch*avpch, blength))

在版本5中是math.sqrt

这也不是你导入库的方式,但是像这样的内置库已经加载了

最新更新