7、變色RSI N:=3; N1:=5;N2:=10;N3:=20;N4:=1;M1:=7;M2:=2; LC :=REF(C,N4); RSI1:SMA(MAX(C-LC,0),N1,1)/SMA(ABS(C-LC),N1,1)*100,COLORRED,LINETHICK1; RSI2:SMA(MAX(C-LC,0),N2,1)/SMA(ABS(C-LC),N2,1)*100,COLOR0099FF; RSI3:SMA(MAX(C-LC,0),N3,1)/SMA(ABS(C-LC),N3,1)*100,COLORYELLOW,LINETHICK1; IF(RSI1<RSI2,RSI1,DRAWNULL),COLORAA8800,LINETHICK1; IF(RSI2>RSI1,RSI2,DRAWNULL),COLORAA8800,LINETHICK1; IF(RSI3>RSI2,RSI3,DRAWNULL)COLORAA8800,LINETHICK1; TY:=RSI1;{通用曲線值的引入} AA:=REF(TY,N)=HHV(TY,2*N+1); BB:=BACKSET(AA,N+1); CC:=FILTER(BB,N) AND TY=HHV(TY,N+1); DRAWICON(CC,TY*1.07,10); AA2:=REF(TY,N)=LLV(TY,2*N+1); BB2:=BACKSET(AA2,N+1); CC2:=FILTER(BB2,N) AND TY=LLV(TY,N+1); DRAWICON(CC2,TY*0.95,11); GG:=ISLASTBAR AND REF(CC,BARSLAST(CC)); HH:=BACKSET(GG,BARSLAST(CC)+1); II:=HH>REF(HH,1); JJ:=REF(BARSLAST(CC),1); KK:=BACKSET(II,JJ+2); LL:=KK>REF(KK,1); DRAWLINE(LL,TY,II,TY,1),COLORRED; CS:=(REF(TY,BARSLAST(II))-REF(TY,BARSLAST(LL)))/(BARSLAST(LL)-BARSLAST(II)); 阻力線:=REF(TY,BARSLAST(II))+BARSLAST(II)*CS; 阻力值:阻力線,LINETHICK0; DRAWICON(CROSS(TY,阻力線),阻力線*0.99,12); GG2:=ISLASTBAR AND REF(CC2,BARSLAST(CC2)); HH2:=BACKSET(GG2,BARSLAST(CC2)+1); II2:=HH2>REF(HH2,1); JJ2:=REF(BARSLAST(CC2),1); KK2:=BACKSET(II2,JJ2+2); LL2:=KK2>REF(KK2,1); DRAWLINE(LL2,TY,II2,TY,1),COLORGREEN; |
|