如何在 pine 脚本中绘制一个条件为 RSI 必须大于 x 但小于 y 的指标?

How can I plot an indicator with a condition that RSI must be greater than x but less than y in pine script?

我只想绘制一个 rsi 值从 52 到 80 的指标,但每当我将范围格式放在下面时:

rsiup = 50 < rsi < 80
rsidown = 30 < rsi < 50

然后我得到这个错误:

Cannot call 'operator <' with argument 'expr0'='call 'operator <' (series bool)'. An argument of 'series bool' type was used but a 'const float' is expected

请帮忙

您需要将其分解为两个 and 条件。

rsiup = (50 < rsi) and (rsi < 80)
rsidown = (30 < rsi) and (rsi < 50)