v5如何以序列为长度复制rsi行为

  • 本文关键字:复制 rsi 行为 v5 pine-script
  • 更新时间 :
  • 英文 :


在pinescriptv4中,可以传递一个序列作为length参数。
如文档所述:

If x is a series and y is a series then x and y are considered to be 2 calculated MAs for upward and downward changes.

现在用v5是不可能的了。你只能传递一个简单的整数。
考虑到不可能将一个序列转换为一个简单的整数,我如何实现前面的行为?

如果您想实现在v4中将序列长度传递给rsi()时发生的相同行为,则可以使用公式。公式见Pine用户手册:

100.0 - (100.0 / (1.0 + arg1 / arg2))

最新更新