"Cannot call 'ta.rsi' with argument 'length'='lowers'. An argument of 'series float' type was used but a 'simple int' is expected"

"Cannot call 'ta.rsi' with argument 'length'='lowers'. An argument of 'series float' type was used but a 'simple int' is expected"

我在 pine 脚本中遇到这个错误 有人可以帮我解决这个代码吗 这是我的代码

无法使用参数 'length'='lowers' 调用 'ta.rsi'。使用了 'series float' 类型的参数,但需要 'simple int'

source =(high + low + close)/3
length = input.int(14, minval=1) 
Highlight=input.bool(true, title="Highlight Oversold and Overbought")
uppers = math.sum(volume * (ta.change(source) <= 0 ? 0 : source), length)
lowers = math.sum(volume * (ta.change(source) >= 0 ? 0 : source), length)
mfi = ta.rsi(uppers, lowers)
mfp = plot(mfi, color=color.gray, linewidth=1)

mfi = ta.rsi(uppers, lowers)替换为mfi = 100.0 - (100.0 / (1.0 + uppers / lowers))以获得您想要的计算; ta.rsi() 不能再像那样计算 mfi 了。您可以阅读有关此行为的更多信息 in the migration guide.