Hello, below mentioned (in the code section) is the code for a RSI and its related Bollinger Band (BB). Help is needed for plotting divergence (defined by (1) ZSR (defined in the PRT code) touching LB (defined in the PRT code) and then price going down to make a lower low but ZSR staying above LBB, (2) ZSR touching UB and then price going up to make a higher high but ZSR staying below UBB). ZMYR = RSI[21](close) ZSR = RSI[2](ZMYR)-50 M=wilderAVERAGE[18](ZSR) SD=STD[18](ZSR) UB=M+1.2*SD LB=M-1.2*SD Return zsr as "MOMENTUM", ub as "OverBought", lb as "OverSold"