INPUT:N1(5,2,100,1),N2(13,2,100,1);
REFLINE: 0, 20, 50, 80, 100;
LC := REF(CLOSE,1);
RSI1:SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100;
RSI2:SMA(MAX(CLOSE-LC,0),N2,1)/SMA(ABS(CLOSE-LC),N2,1)*100;
RSI:RSI1,COLORGRAY;
FILLRGN(RSI1,RSI2,RSI1>=RSI2 AND RSI1>=50 AND RSI1<80,RGB(255,0,0), RSI1<80 AND RSI1>=50 AND RSI1<RSI2,RGB(255,255,0),RSI1<50 AND RSI1>20,RGB(0,255,0));
FILLRGN(RSI1,80,RSI1>=80,RGB(255,0,255));
FILLRGN(RSI1,20,RSI1<=20,RGB(0,0,255));