通达信KDJ短线通道主图源码
SAT:=IF((AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100>100,100,(AMOUNT/C)/(HHV(AMOUNT,20)/HHV(C,20))*100);
AA10:=MA(CLOSE,8),COLOR0000FF;
AA12:=MA(CLOSE,12),COLOR0000FF;
BB10:=((ATAN((AA10 - REF(AA10,1))) * 3.1416) * 10);
BB12:=((ATAN((AA12 - REF(AA12,1))) * 3.1416) * 10);
MA13:=MA(CLOSE,13);
STICKLINE((((AA12 <= AA10) AND (BB12 >= 1)) AND (BB10 >= 1)),AA10,AA12,4,0),COLOR0080FF;
STICKLINE((((AA12 >= AA10) AND (BB10 <= 1)) AND (BB10 <= 1)),AA10,AA12,4,0),COLOR00FF00;
X1:=(C+L+H)/3;BB13:=ATAN(EMA(X1,13)-REF(EMA(X1,13),1))*3.1416*10;
EMA8:=EMA(C,8);DRAWTEXT(FILTER(BB13>1 AND EMA(X1,13)>REF(EMA(X1,8),1),10),
EMA8,'∠45上升'),COLORWHITE;
压力:=MA(REF(HHV(C,30),1),2),COLOR9DFFFF;
支撑:=MA(REF(LLV(C,30),1),2),COLORABFF46;
AA1:=AMOUNT/V;
BB1:=L<AA1*0.9;
CC1:=(C-REF(C,1))/REF(C,1)*100>1.2;
DD1:=L<MA(C,5)*0.921;
EE1:=V<MA(V,5)*1.5;
FF1:=BB1 AND CC1 AND DD1 AND EE1;DRAWTEXT(FF1,(LOW* 0.99),'老鼠仓'),COLOR4080FF;
A51:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1);
黑马线:=EMA(A51,5);A54:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;
趋势线:=(MA(3*SMA(A54,6,1)-2*SMA(SMA(A54,5,1),5,1),2));
DRAWTEXT(CROSS(趋势线,0)AND 黑马线<40,(HIGH* 0.97),'▲大黑马'),COLORYELLOW;
LC:=REF(CLOSE,1);RSI:=((SMA(MAX((CLOSE - LC),0),3,1) / SMA(ABS((CLOSE - LC)),3,1)) * 100);
FF:=EMA(CLOSE,3);MA15:=EMA(CLOSE,21);DRAWTEXT(CROSS(FF,MA15),(LOW * 0.99),'底背离'),COLORA6E500;
DRAWTEXT(CROSS(88,RSI),(HIGH * 1.02),'顶背离'),COLOR1880FF;
VAR2:=LLV(LOW,27);VAR3:=HHV(HIGH,34);
VAR4:=EMA((CLOSE-VAR2)/(VAR3-VAR2)*4,4)*25;
注意买:=IF((VAR4<10),80,100);
RSV:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;
K:=SMA(RSV,3,1);D:=SMA(K,3,1);
J:=3*K-2*D;超跌:=IF(J<0,10,0);
BDDD:=LLV(J,2)=LLV(J,8);
买入:=IF(CROSS(J,REF(J+0.01,1)) AND BDDD AND J<20,30,0);
DRAWTEXT(买入 AND 注意买=100 AND 超跌=0,LOW,'短线'),COLOR8000FF;
MTM:=C-REF(C,1);DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);
买:=IF(LLV(DX,2)=LLV(DX,7) AND COUNT(DX<0,2) AND CROSS(DX,MA(DX,2)),1,0);
中轴:=MA(CLOSE,26),COLORRED;
上轨:=中轴+2*STD(CLOSE,26),COLORMAGENTA;
下轨:=中轴-2*STD(CLOSE,26),COLORYELLOW;
W1:=C=HHV(C,20);
W2:=BARSLAST(W1);
W3:=IF(W2>0,REF(C,W2),REF(C,W2));
W4:=CROSS(C,REF(W3,1));
★关注:IF(W4 AND COUNT(W4,5)=1,20,DRAWNULL),NODRAW,COLORRED;
DRAWICON(W4 AND COUNT(W4,5)=1,L,1);
ZT:=(C/REF(C,1)>1.097 OR BETWEEN(C/REF(C,1),1.0495,1.051)) AND H=C;
STICKLINE(ZT,O,C,2.3,0),COLORRED;
DRAWTEXT(ZT=1,LOW-0.05,'↖'),COLORRED;
DRAWTEXT(ZT=1,LOW-0.05,' 涨停'),COLOR0000DD;
A3X:=V/WINNER(L);
A4X:=REF(HHV(C,120),1);
A5X:=REF(LLV(C,120),1);
A6X:=100*(C-A5X)/(A4X-A5X);
A8X:=A3X/REF(A3X,3)>=3 AND A6X<80 ;
A9X:=REF(A8X,1) OR REF(A8X,2) OR REF(A8X,3) OR REF(A8X,4);
A10X:=A8X AND A9X;
A12X:=IF(FILTER(A10X,3),10,0);
CCC:=ABS((2*CLOSE+HIGH+LOW)/4-MA(CLOSE,20))/MA(CLOSE,20);
DD20:=DMA(CLOSE,CCC);
通道44:=(1-7/100)*DD20;
A20:=C<通道44 AND C>O;
TYP2:=(HIGH+LOW+CLOSE)/3;
CCI2:=(TYP2-MA(TYP2,14))/(0.015*AVEDEV(TYP2,14));
MIDD:=MA(CLOSE,20);
LOWERR:=MIDD-2*STD(CLOSE,20);
XGG:=A20 AND CCI2<-100 AND O<LOWERR;
XIN:=A12X AND XGG;
XX:=BARSLAST(XIN);
〖止盈价〗:IF(XX<=10 AND REF(COUNT(H<REF(C,XX)*1.1,XX)=XX,1) AND REF(COUNT(C>=REF(C,XX)*0.95,XX)=XX,1),REF(C,XX)*1.1,DRAWNULL),NODRAW,COLORYELLOW;
〖止损价〗:IF(XX<=10 AND REF(COUNT(H<REF(C,XX)*1.1,XX)=XX,1) AND REF(COUNT(C>=REF(C,XX)*0.95,XX)=XX,1),REF(C,XX)*0.95,DRAWNULL),NODRAW,COLORWHITE;
〖平仓价〗:IF(XX=10 AND REF(COUNT(H<REF(C,XX)*1.1,XX)=XX,1) AND REF(COUNT(C>=REF(C,XX)*0.95,XX)=XX,1),C,DRAWNULL),NODRAW;
DRAWICON(XIN,C*0.95,1);
DRAWICON(COUNT(H<REF(C,XX)*1.1,XX)=XX AND XX=10 AND COUNT(C>REF(C,XX)*0.95,XX)=XX,REF(C,XX)*1.1,2);
DRAWICON(H>=REF(C,XX)*1.1 AND XX<=10 AND REF(COUNT(H<REF(C,XX)*1.1,XX)=XX,1) AND REF(COUNT(C>REF(C,XX)*0.95,XX)=XX,1),REF(C,XX)*1.1,2);
DRAWICON(COUNT(H<REF(C,XX)*1.1,XX)=XX AND XX<=10 AND REF(COUNT(C>REF(C,XX)*0.95,XX)=XX,1) AND C<=REF(C,XX)*0.95,REF(C,XX)*1.1,2);
MTM2:=C-REF(C,1);
DX2:=100*EMA(EMA(MTM2,6),6)/EMA(EMA(ABS(MTM2),6),6);
买2:=LLV(DX2,2)=LLV(DX2,7) AND COUNT(DX2<0,2) AND CROSS(DX2,MA(DX2,2));
DRAWICON(FILTER(买2=1,5),L*0.97,1);
MA20:=MA(C,20),COLORRED,LINETHICK2;
MA55:=MA(C,55),COLOR00FF00,LINETHICK2;
BB:=MA(MA(CLOSE,3),1),LINETHICK3,COLOR00FFFF;
TT:=IF(ISLASTBAR,240/FROMOPEN,1);
NN:=120;
HH:=HHV(V*TT,NN);
LL:=LLV(V,NN);
最高:=CONST(HH);
最低:=CONST(LL);
最高2:=CONST(HHV(H,NN));
最低2:=CONST(LLV(L,NN));
PP:=IF((最高2*0.9-(最高2-最低2)*0.5)>CONST(LLV(L,20)),0.9,IF((最高2*0.9-(最高2-最低2)*0.5)>CONST(LLV(L,50)),0.7,0.6)),NODRAW;
RCC1:=最高2*0.9-(最高2-最低2)*PP;
最低3:=MIN(RCC1,最低2);
AA:=最低3;
周J:=MA("KDJ.J#WEEK"(9,3,3) ,5),COLORFFFF00,LINETHICK2;
AA01:=周J<0 AND 周J<REF(周J,1) ;
FF01:=周J<0 AND 周J>REF(周J,1);
BB01:=周J>=0 AND 周J<85 AND 周J>REF(周J,1);
DD01:=周J>=REF(周J,1) AND 周J>=85 ;
EE01:=周J<REF(周J,1) AND 周J>0;
ZJ1:=MA("KDJ.J#WEEK"(9,3,3) ,5);
YK:=MA("KDJ.K#MONTH"(9,3,3),20),LINETHICK0;
YD:=MA("KDJ.D#MONTH"(9,3,3),20),LINETHICK0;
YJ:=MA("KDJ.J#MONTH"(9,3,3),20);
ZK:=MA("KDJ.K#WEEK"(9,3,3) ,5),LINETHICK0;
ZD:=MA("KDJ.D#WEEK"(9,3,3) ,5),LINETHICK0;
RSV2:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K2:=SMA(RSV,3,1),LINETHICK0;
D2:=SMA(K2,3,1),LINETHICK0;
J2:=3*K2-2*D2,LINETHICK0;
GG1:=C>0;
RJC:=DRAWICON(CROSS(K2,D2),L*0.98,1);
DRAWTEXT(RJC,L*0.98,'日金'),COLOR0000FF;
RSC:=DRAWICON(CROSS(D2,K2),H*1.03,2),;
ZJC:=DRAWICON (CROSS(ZK,ZD), L*0.98,1);
DRAWTEXT(ZJC,L*0.98,'周金'),COLORFF00FF;
ZSC:=DRAWICON (CROSS(ZD,ZK), H*1.03,2),;
YJC: DRAWICON (CROSS(YK,YD), L*0.98,1);
DRAWTEXT(YJC,L*0.98,'月金'),COLORFF0000;
YSC:=DRAWICON (CROSS(YD,YK), H*1.03,2),;
STICKLINE(AA01,AA-0.000*AA,AA-0.040*AA,2.5,1),COLOR6600BB;
STICKLINE(FF01,AA-0.000*AA,AA-0.040*AA,2.5,0),COLOR0000FF;
STICKLINE(BB01,AA-0.000*AA,AA-0.040*AA,2.5,0),COLORFF00FF;
STICKLINE(DD01,AA-0.000*AA,AA-0.040*AA,2.5,0),COLOR00FF00;
STICKLINE(EE01,AA-0.000*AA,AA-0.040*AA,2.5,1),COLORFFFF00;
STICKLINE(GG1,AA-0.050*AA,AA-0.090*AA,2.5,1),COLORBB0000;
STICKLINE(RJC,AA-0.050*AA,AA-0.090*AA,2.5,0),COLOR0000FF;
STICKLINE(RSC,AA-0.050*AA,AA-0.090*AA,2.5,0),COLORFFFFFF;
STICKLINE(ZJC,AA-0.050*AA,AA-0.090*AA,2.5,0),COLORFF00FF;
STICKLINE(ZSC,AA-0.050*AA,AA-0.090*AA,2.5,0),COLOR00FFFF;
STICKLINE(YJC,AA-0.050*AA,AA-0.090*AA,2.5,0),COLORFF0000;
STICKLINE(YSC,AA-0.050*AA,AA-0.090*AA,2.5,0),COLORFFFF00;