'How can I plot an indicator with a condition that RSI must be greater than x but less than y in pine script?
I want to plot an indicator with an rsi value from 52 to 80 only but whenever I put a range format below:
rsiup = 50 < rsi < 80
rsidown = 30 < rsi < 50
then I get this error:
Cannot call 'operator <' with argument 'expr0'='call 'operator <' (series bool)'. An argument of 'series bool' type was used but a 'const float' is expected
Please help
Solution 1:[1]
You need to break it down into two and conditions.
rsiup = (50 < rsi) and (rsi < 80)
rsidown = (30 < rsi) and (rsi < 50)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | vitruvius |
