In Pine version 5, the namespace
concept has been introduced as there existed too many functions in the Pinescript language library. Every built-in function has been grouped into different namespaces.
barssince
is in the Technical Analysis category, so it is in the ta
namespace. When you use a function in v5, you have to specify the namespace, the function name and these 2 are separated by a dot.
The proper use of barssince()
in v5 is: ta.barssince()
.
Anytime you have doubts about a function definition, start the on-screen help where you can search for either v4 or v5 function definitions. You can start the on-screen help by looking for a keyword which is usually displayed in blue color, hover your mouse over it and press Ctrl+click. If you just hover your mouse over a keyword, a pop-up help will appear but you cannot interact with that popup window.
Your use of RSI function has issues as that function requires two arguments. The RSI function is also in the Technical Analysis group so it also has the ta.
namespace prefix.
Your example code should look like this:
BarsSinceRsiOverSold = ta.barssince(ta.rsi(close, 14) < 30)