I updated the title of your question because it stated the exact opposite of what you are requesting in the body of your question.
Please note that you only provided one parameter for the StochasticSlow (14) when there are several. So I selected to use a value of 14 for the "k period" for my solution below:
input targetValue = 50.0;
def rsiValue = RSI(14)."RSI";
def slowK = StochasticSlow("k period" = 14)."SlowK";
def difference = AbsValue(rsiValue - slowK);
plot scan = difference < targetValue;
When we do not provide a value for the the other parameters, the platform will use the default value that is set for the built-in chart study.
Here is list of the other parameters for which you did not provide a value:
- "d period"
- "price h"
- "price l"
- "price c"
- "average type"
Each of those parameters will have an impact on how the StochasticSlow is computed.