LC: =REF (CLOSE,1); TEMP1: =MAX (CLOSE-LC,0); TEMP2: =ABS (CLOSE-LC); RSI1: SMA (TEMP1,14,1) /SMA (TEMP2,14,1) *100, COLORFF8D1E; 30, DOTLINE; 50, DOTLINE; 70, DOTLINE; N: =3; A1: =REF (RSI1, N) =HHV (RSI1, 2*N+1) ); B1: =BACKSET (A1, N+1); C1: =FILTER (B1, N); PERIOD_TOP: =BARSLAST (REF (C1,1)); TOP_DIV: =REF (CLOSE, PERIOD_TOP+1) RSI1 AND C1; DRAWLINE (REF (C1,1), REF (RSI1,1), FILTER (TOP_DIV,5), RSI1,0), COLORBLUE, LINETHICK3; FILLRGN (RSI1,70, RSI1>=70), COLORRED; A2: =REF (RSI1, N) =LLV (RSI1, N+1); B2: =BACKSET (A2, N+1); C2: =FILTER (B2, N); PERIOD_BOT: =BARSLAST (REF (C2,1)); BOT_DIV: =REF (CLOSE, PERIOD_BOT+1) > CLOSE AND REF (RSI1, PERIOD_BOT+1) <RSI1 AND C2;
DRAWLINE (REF (C2,1), REF (RSI1,1), FILTER (BOT_DIV,5), RSI1,0), COLORRED, LINETHICK3;
FILLRGN (RSI1,30, RSI1<=30), COLORGREEN;