大智慧版本源码如下:
VAR88:=IF((YEAR >= 2308) and (MONTH >= 1),0,1); RSVa:=(((CLOSE - LLV(LOW,21))/(HHV(HIGH,21) - LLV(LOW,21)))*(100))*(VAR88);
趋势:=(MA((3)*(SMA(RSVa,6,1)) - (2)*(SMA(SMA(RSVa,5,1),5,1)),2))*(VAR88);
VAR2a:=(3)*(SMA(((OPEN - LLV(LOW,89))/(HHV(HIGH,89) - LLV(LOW,89)))*(100),20,1)) - (2)*(SMA(SMA(((OPEN - LLV(LOW,89))/(HHV(HIGH,89) - LLV(LOW,89)))*(100),20,1),15,1));
VAR3a:=VAR2a - 100;
背离:=(FORCAST(((-1))*(VAR3a),21))*(VAR88);
跟踪天数:(BARSLAST((趋势 < 背离)))*(VAR88),colorred;
MA15:=EMA(CLOSE,21);
STICKLINE((MA15 > REF(MA15,1)),MA15,MA15,9,6),LINETHICK2,color0000FF;
STICKLINE((MA15 < REF(MA15,1)),MA15,MA15,9,6),LINETHICK2,colorFF0000;
倚天指标版本源码:
参数:n=21,m=6,p=5
源码
RSV:=(C-LLV(L,n))/(HHV(H,n) - LLV(L,n))*100;
趋势:MA((3*SMA(RSV,m,1)-2*SMA(SMA(RSV,5,1),p,1)),2),LINETHICK1,COLORFF00FF;
VAR2:=3*(SMA(((OPEN - LLV(LOW,55))/(HHV(HIGH,55) - LLV(LOW,55)))*(100),20,1))-2*(SMA(SMA(((OPEN - LLV(LOW,55))/(HHV(HIGH,55) - LLV(LOW,55)))*(100),20,1),15,1));
VAR3:=VAR2-100;
背离:FORCAST(-1*VAR3,8),LINETHICK1,COLORwhite;
DRAWTEXT((CROSS(趋势,背离)),背离,'黑马'),COLORE7FCB9;
跟踪天数:BARSLAST(趋势 < 背离),LINETHICK0;
partline(跟踪天数 >REF(跟踪天数,1),跟踪天数),COLORRED,LINETHICK2;