大家都知rsi 灵敏度很高,很少滞后, 但初学者慎用
源码如下: {参数 最小 最大 缺省 M 2 99 12 N1 2 99 6 N2 2 99 13 p 1 99 2} LC:=REF(CLOSE,1); RS1:=SMA(MAX(CLOSE-LC,0),M,1)/SMA(ABS(CLOSE-LC),M,1)*100; SM:MA(RS1,20),COLORFF00FF,NODRAW; SU:SM+2*STD(RS1,20),COLORFFFF00,NODRAW; SD:SM-2*STD(RS1,20),COLOR00FF00,NODRAW; ATR:=MA(MAX(MAX((RS1-RS1),ABS(REF(RS1,1)-RS1)),ABS(REF(RS1,1)-RS1)),15); VM:MA(RS1,N1),COLORFF00FF,NODRAW; VU:VM+2.3*ATR,COLORFFFFFF,NODRAW; VD:VM-2.1*ATR,COLOR00FFFF,NODRAW; DRAWBAND(SU,RGB(140,150,140),SD,RGB(0,150,130)); DRAWBAND(VU,RGB(0,224,224),VD,RGB(220,220,220)); DRAWTEXT(ISLASTBAR AND RSI>REF(RSI,1),VM,' ▲'),COLORDD00FF; DRAWTEXT(ISLASTBAR AND RSI<REF(RSI,1),VM,' ▼'),COLOR00EE00; 超买:70,COLORBLUE,LINETHICK1; 超卖:30,COLORWHITE,LINETHICK2; MA1:MA(RS1,N1),COLORCYAN; MA2:MA(RS1,N2),COLORCYAN,LINETHICK1; RSI:RS1,COLORRED,LINETHICK2; {RSI划线} OB:=RS1; A1:=REF(OB,P)=HHV(OB,2*P+1); B1:=FILTER(A1,P); C1:=BACKSET(B1,P+1); D1:=FILTER(C1,P);{高点} A2:=REF(OB,P)=LLV(OB,2*P+1); B2:=FILTER(A2,P); C2:=BACKSET(B2,P+1); D2:=FILTER(C2,P);{低点} T11:=BACKSET(ISLASTBAR,BARSLAST(D2)+1); U11:=T11>REF(T11,1); 上升趋势线:DRAWLINE(D2,OB,U11,OB,1),COLORYELLOW,LINETHICK2; 下降趋势线:DRAWLINE(RS1>=HHV(RS1,10),RS1,RS1<=LLV(RS1,3),HHV(RS1,3),1),COLORBLUE,LINETHICK2; |
