{N:1 100 5}
STICKLINE(C>0,0,20,6,0),COLOR000035;
STICKLINE(C>0,100,80,6,0),COLOR000035;
LC:=REF(CLOSE,1);
RSI1:SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
RSI2:SMA(MAX(CLOSE-LC,0),12,1)/SMA(ABS(CLOSE-LC),12,1)*100,COLORRED;
RSI3:SMA(MAX(CLOSE-LC,0),24,1)/SMA(ABS(CLOSE-LC),24,1)*100;
STICKLINE(RSI1>RSI2,0,5,2,0),COLOR0000CC;
DRAWBAND(RSI2,RGB(255,0,0),RSI3,RGB(0,255,0));
DRAWBAND(RSI1,RGB(255,255,0),RSI2,RGB(0,50,255));
A1:=REF(RSI1,N)=HHV(RSI1,2*N+1);
B1:=BACKSET(A1,N+1);
C1:=FILTER(B1,N);
D1:=BACKSET(ISLASTBAR,BARSLAST(C1)+1);
E1:=D1>REF(D1,1);
压力:DRAWLINE(C1,RSI1,E1,RSI1,1),COLORFF00FF;
A2:=REF(RSI1,N)=LLV(RSI1,2*N+1);
B2:=BACKSET(A2,N+1);
C2:=FILTER(B2,N);
D2:=BACKSET(ISLASTBAR,BARSLAST(C2)+1);
E2:=D2>REF(D2,1);
支撑:DRAWLINE(C2,RSI1,E2,RSI1,1),COLORFF00FF;
DD1:=BARSLAST(REF(C1,1));
顶背离:=REF(C,DD1+1)<CLOSE AND REF(RSI1,DD1+1)>RSI1 AND C1;
DRAWLINE(C1,RSI1,顶背离,RSI1,0),COLOR00FF00;
DRAWTEXT(顶背离,RSI1,'顶背离'),COLOR00FF00;
DD2:=BARSLAST(REF(C2,1));
底背离:=REF(C,DD2+1)>CLOSE AND REF(RSI1,DD2+1)<RSI1 AND C2;
DRAWLINE(C2,RSI1,底背离,RSI1,0),COLORRED;
DRAWTEXT(底背离,RSI1,'底背离'),COLORRED;
DRAWTEXT(ISLASTBAR AND RSI1>REF(RSI1,1),50,' ▲'),COLORFF00FF;
DRAWTEXT(ISLASTBAR AND RSI1<REF(RSI1,1),50,' ▼'),COLOR00FF00;
上穿20:IF(CROSS(RSI1,20) ,20,0),COLORYELLOW;
下穿80:IF(CROSS(80,RSI1),80,100),COLORFF8918;