RSI Overbought/Oversold multiple times over 40 bars


Category:
0
0

Hi Peter,

Please provide a scan to find stocks that have been overbought or oversold more than 3 bars in the last 40 bars.  I need help with keeping a count for 40 bars.  If this has been answered somewhere let me know.

Thanks in advance for any help you can provide.  Love this site and all your helpful videos.

 

Marked as spam
Posted by (Questions: 1, Answers: 1)
Asked on October 21, 2018 8:14 am
146 views
1
Private answer

Haven’t tested this. But it should do the trick:

input length = 14;
input overBought = 70;
input overSold = 30;
input price = close;
input averageType = AverageType.WILDERS;
def netChgAvg = MovingAverage(averageType, price - price[1], length);
def totChgAvg = MovingAverage(averageType, AbsValue(price - price[1]), length);
def chgRatio = if totChgAvg != 0 then netChgAvg / totChgAvg else 0;
def rsi = 50 * (chgRatio + 1);
def rsiOverBought = rsi > overBought;
def rsiOverSold = rsi < overSold;
def rsiSum = Sum(rsiOverBought, 40) + Sum(rsiOverSold, 40);
plot scan = rsiSum > 3;

Marked as spam
Posted by (Questions: 37, Answers: 4087)
Answered on October 21, 2018 9:47 am
0

Thank you Peter…works perfectly on the chart, I believe.

( at October 22, 2018 5:20 am)