通达信天下无敌公式
{天下无敌KDJ}
N:=9;M1:=3;M2:=3;
RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100,LINETHICK2;
K:SMA(RSV,M1,1),COLOR00FF00,LINETHICK2;
IF(K>=REF(K,1),K,DRAWNULL),COLOR4080FF,LINETHICK2;
D:SMA(K,M2,1),LINETHICK1,COLORFFFFB0;
J:3*K-2*D,COLORC4C4FF,LINETHICK1;
IF(J<=0,J,DRAWNULL),COLORFF00FF,LINETHICK2;
IF((J>=98 OR (J>REF(J,1) AND J>=70)),J,DRAWNULL),COLOR0000FF,LINETHICK2;
{IF(K>90,K,DRAWNULL),COLOR0000FF,LINETHICK2;
IF(D>85,D,DRAWNULL),COLORFFFF11,LINETHICK2;}
{DRAWICON(CROSS(J,1),J,25);
DRAWICON(K>80 AND D>80 AND CROSS(D,K),J,27);}
XG:=COUNT(J<0,8)>=3 AND CROSS(J,1) AND K>=REF(K,1);
DRAWICON(XG,0,9);
{DRAWICON(CROSS(J,0)AND K>=REF(K,1),J,1);
DRAWICON(CROSS(J,20)AND K>=REF(K,1),J,1);
DRAWICON(CROSS(100,J)AND K<=REF(K,1),J,2);
DRAWICON(CROSS(80,J)AND K<=REF(K,1)<100,J,2);}
MA3:=MA(C,3);MA7:=MA(C,7);MA10:=MA(C,10);MA20:=MA(C,20);MA55:=MA(C,55);
MA120:=MA(C,120);
A:=(H>=MA55) OR (H>=MA120);
B:=(BETWEEN(MA55,H,L)) OR (BETWEEN(MA120,H,L));
BB:=BETWEEN(MA3,C,O) AND BETWEEN(MA7,C,O) AND BETWEEN(MA10,C,O) AND C>O AND
BETWEEN(MA20,C,O) AND C>MA55 ,NODRAW,COLOR00FFFF;
DRAWTEXT(ISLASTBAR,19,'KD 金叉买入 .'),COLOR9000FF;
DRAWTEXT(ISLASTBAR,79,'KD 死叉卖出 .'),COLORFFFF00;
DRAWTEXT(CURRBARSCOUNT=3,3,'J<0 股价易反转上涨 .'),COLOR0000FF;
DRAWTEXT( CURRBARSCOUNT=3,95,'J>100 股价易反转下跌 .'),COLOR00FF00;
DRAWTEXT(ISLASTBAR,0,'______________高安全区'),COLORRED;
DRAWTEXT(ISLASTBAR,23,'安 全 区'),COLOR4080FF;
DRAWTEXT(ISLASTBAR,83,'风 险 区'),COLORFFABAB;
DRAWTEXT(ISLASTBAR,100,'高风险区'),COLORGREEN;
100,COLORFF6060;
70,COLORFF90FF;
50,POINTDOT,COLORLIRED;
20,COLORFF00FF;
120,COLOR00FF00,POINTDOT;