通达信MKJ大杂烩,源码
MKJ大杂烩,需要的拿去
有同学要的MKJ,其实是将坛子里老师们的指标组合的一个大杂烩,自己觉得还需优化,需要的拿去一起优化
DRAWGBK(CURRBARSCOUNT=1, RGB(110,108,108),RGB(88,30,0),0,'',0); {4.17以下版本删除这一行,是背景}
V1:=(CLOSE-MA(CLOSE,20))/MA(CLOSE,20)*100;
V2:=IF(V1>0,V1,0),COLORLICYAN;
V3:=STICKLINE(V1>0,V1,0,3,0),COLORRED;
U4:=EMA(EMA(V1,30),3)*2,COLORFF99FF;
DRAWBAND(V1, RGB(110,108,108),U4,RGB(88,30,0));
DRAWBAND(V1, RGB(221,48,11),0,RGB(88,30,0));
RSV1:=(CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100;
K1:=SMA(RSV1,5,1);
D1:=SMA(K1,5,1);
J1:=3*K1-2*D1;
AA1:=EMA(J1,5);
AA2:=REF(AA1,1);
{STICKLINE(AA1>AA2,AA1,AA2,1,0),COLOR00CEFF;
STICKLINE(AA1<=AA2,AA1,AA2,1,0),COLOR858500;}
ZK:=MA("KDJ.K#WEEK",4);
ZD:=MA("KDJ.D#WEEK",4);
DRAWBAND(IF(PERIOD>=4 ,ZK,DRAWNULL),RGB(158,28,168),ZD,RGB(50,50,50));
DRAWBAND(AA1,RGB(255,255,38),AA2,RGB(0,255,0));
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1),COLORGREEN;
D:=SMA(K,3,1);
J:3*K-2*D,COLORFFFFFF;
BB1:=EMA(J,5);
BB2:=REF(BB1,1);
STICKLINE(BB1>BB2,BB1,BB2,1,0),COLOR0000FF;
STICKLINE(BB1<=BB2,BB1,BB2,1,0),COLORBLUE;
DD:=AA1>AA2 AND BB1>BB2;
注意买入:=DD AND NOT(REF(DD,1)) AND (AA1<50 OR BB1<50) ;
DRAWICON(注意买入,-5,1);
注意卖出:=REF(DD,1)=1 AND NOT(DD);
DRAWICON(注意卖出,105,2);
KQ:=SMA(RSV,9,1);
DQ:=SMA(KQ,9,1);
JQ:=3*KQ-2*DQ;
X2:=LLV(JQ,2)=LLV(JQ,8);
DRAWICON(CROSS(JQ,REF(JQ+0.01,1)) AND X2 AND JQ<20,50,11);
共振点:=(CROSS(AA1,AA2) AND CROSS(BB1,BB2)) OR (CROSS(AA1,AA2) AND BB1>BB2)
OR (AA1>AA2 AND CROSS(BB1,BB2)) OR (CROSS(KQ,DQ) AND CROSS(K,D));
STICKLINE(共振点>0,0,100,0,0),COLORYELLOW;
TYP:=(HIGH+LOW+CLOSE)/3;
CCI14:=(TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));
CCI89:=(TYP-MA(TYP,89))/(0.015*AVEDEV(TYP,89));
VAAR8:=IF(CCI14>=150 AND CCI14<200 AND CCI89>=150 AND CCI89<200,10,0);
VAAR9:=IF(CCI14<=-150 AND CCI14>-200 AND CCI89<=-150 AND CCI89>-200,-10,VAAR8);
VARA:=(CLOSE-MA(CLOSE,13))/MA(CLOSE,13)*100;
VARB:=100-ABS(VARA);{乖离}
OX:=IF(VARB<90,VARB,100);
STICKLINE(VARB<90,80,VARB,0,0),COLORFFFFFF;{正负乖离}
预警:=IF(CCI89>=200 AND CCI14>=150,15,IF(CCI89<=-200 AND CCI14<=-150,-15,VAAR9))+60;
DRAWTEXT(预警>65,75,'↓'),COLORGREEN;
DRAWTEXT(预警<58,75,'↑'),COLORRED;
{趋势顶底}
A:=MA(-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34)),19);
B:=-100*(HHV(HIGH,14)-CLOSE)/(HHV(HIGH,14)-LLV(LOW,14));
DDD:=EMA(-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-LLV(LOW,34)),4);
中线:=DDD+100;
长线:=A+100;
短线:=B+100;
见顶:=(REF(中线,1)>85 AND REF(短线,1)>85 AND REF(长线,1)>65) AND CROSS(长线,短线);
顶Q:(中线<REF(中线,1) AND REF(中线,1)>80) AND (REF(短线,1)>95 OR REF(短线,2)>95 ) AND 长线>60 AND 短线<83.5
AND 短线<中线 AND 短线<长线+4,COLORGREEN;
顶部2:=FILTER(顶Q,4);
底Q:(长线<12 AND 中线<8 AND (短线<7.2 OR REF(短线,1)<5) AND (中线>REF(中线,1) OR 短线>REF(短线,1)))
OR (长线<8 AND 中线<7 AND 短线<15 AND 短线>REF(短线,1)) OR (长线<10 AND 中线<7 AND 短线<1),COLORFF00FF ;
STICKLINE( 见顶 OR 顶部2,106,104,20,1 ),COLORGREEN;
STICKLINE( 底Q,-4,0,6,0 ),COLORFF00FF;
金叉:=长线<15 AND REF(长线,1)<15 AND 中线<18 AND 短线>REF(短线,1) AND CROSS(短线,长线) AND 短线>中线
AND (REF(短线,1)<5 OR REF(短线,2)<5 ) AND (中线>=长线 OR REF( 短线,1)<1 );
DRAWTEXT(金叉,-5,'低金'),COLORRED;
{趋势操盘}
VARR3:=((HHV(H,21)-C)/(HHV(H,21)-LLV(L,21)))*100-10;
VARR4:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;
VARR5:=SMA(VARR4,13,8);
VARR6:=SMA(VARR3,21,8);
操盘:=CEILING(SMA(VARR5,13,8));
顶部:IF((操盘-VARR6>85),90,100),COLORCYAN,LINETHICK1;
DRAWTEXT(V>=2*REF(V,1),90,'V'),COLORFFFFFF;
VARA8:=EMA(REF(CLOSE,1),4);
色彩峰:=(SMA(MAX(CLOSE-VARA8,0),6,1)/SMA(ABS(CLOSE-VARA8),6,1)*100);{RSI6}
飞燕:=CROSS(色彩峰,90);
DRAWTEXT(飞燕,95,'ヲ'),COLORDBDBDB;
20,DOTLINE,COLORFFFFFF;
DIFF:=(EMA(CLOSE,8)-EMA(CLOSE,20))*100,COLORRED;
DDEA:=EMA(DIFF,6),COLOR00FFFF;
BDDD:=LLV(J,2)=LLV(J,8);
加码:=IF(CROSS(J,REF(J+0.01,1)) AND BDDD AND BETWEEN(J,20,60),1,0);
DRAWTEXT(加码,50,'★'),COLORFFFFFF;
共振:=CROSS(DIFF,DDEA) AND CROSS(K,D);
DRAWTEXT(共振,50,'★'),COLORLIMAGENTA;
BDGD:=HHV(J,2)=HHV(J,8) AND J>80;
小心:IF(CROSS(REF(J-0.01,1),J) AND REF(BDGD,1),100,80),COLORGREEN;
{通用操盘线}
获利比:=MA(WINNER(CLOSE)*100,5);
获利均线:=SMA(获利比,3,1);
快线:=MA((3*SMA((C-LLV(L,9))/(HHV(HIGH,9)-LLV(LOW,9))*100,3,1)-2*SMA(SMA((C-LLV(L,9))/(HHV(HIGH,9)-LLV(LOW,9))*100,3,1),3,1)),2);
操盘线:=MA(3*SMA((C-LLV(L,21))/(HHV(H,21)-LLV(L,21))*100,5,1)-2*SMA(SMA((C-LLV(L,21))/(HHV(H,21)-LLV(L,21))*100,5,1),3,1),3);
通用操盘线:=MA(3*SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*100,5,1)-2*SMA(SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*100,5,1),3,1),5);
VAR111:=(C*3+H+L+O)/6;
VAR2:=SMA(MAX(C-VAR111,0),8,1)/SMA(ABS(C-VAR111),8,1)*100;
VAR3:=100*(HHV(H,15)-C)/(HHV(H,13)-LLV(L,13))-45;
关注:IF(通用操盘线<5,10,0),COLORFFFFFF,LINETHICK2;
IF(COUNT(获利均线<2,10)>=9 AND CROSS(获利比,获利均线),20,0),COLOR00FFFF;
DRAWTEXT(CROSS(操盘线,通用操盘线)AND 通用操盘线<10,20,'买点'),COLORRED;
DRAWICON(CROSS(VAR2,VAR3)AND 操盘线<20 AND 获利比>REF(获利比,1),3,7);
DRAWTEXT(CROSS(快线,0),-8,'金叉2'),COLOR00FFFF;
LC:=REF(C,1);
RSI:=SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100;
VARB2:=SMA(MAX(CLOSE-LC,0),7,1)/SMA(ABS(CLOSE-LC),7,1)*100;
VARC:=SMA(MAX(CLOSE-LC,0),13,1)/SMA(ABS(CLOSE-LC),13,1)*100;
VARD:=BARSCOUNT(CLOSE);
底部雷达:(VARB2< 20 AND VARC< 25 AND VARD>50)*30,COLOR00FFFF;
EMA13:=EMA(C,13);
EMA34:=EMA(C,34);
EMA55:=EMA(C,55);
AR1:=EMA55>EMA34 AND EMA34>EMA13;
AR2:=BARSLAST((C-EMA13)/EMA13*100<-6);
AR3:=EMA13>=REF(EMA13,2);
AR4:=COUNT(CROSS(C,EMA13),AR2)=1;
AR5:=AR1 AND AR2 AND AR3 AND AR4;
SY:=(AR5 AND FILTER(AR5,10));
DRAWICON(SY,-8,23);
VAR86:=(((CLOSE-MA(CLOSE,6))/MA(CLOSE,6))*100);
VAR87:=(((CLOSE-MA(CLOSE,12))/MA(CLOSE,12))*100);
VAR88:=(((CLOSE-MA(CLOSE,24))/MA(CLOSE,24))*100);
VAR89:=(((VAR86+(2*VAR87))+(3*VAR88))/6);
VAR8A:=MA(VAR89,3);
独门暗器:IF((VAR8A<-10),36,50),COLORCYAN;
{十指金叉}
N1:=3;N2:=5;N3:=9;N4:=13;N5:=21;N6:=34;
DIFF2:=EMA(CLOSE,N3)-EMA(CLOSE,N4);
DEA2:=EMA(DIFF2,N2);
RSI1:=(SMA(MAX(CLOSE-LC,0),N2,1))/(SMA(ABS(CLOSE-LC),N2,1))*100;
RSI2:=(SMA(MAX(CLOSE-LC,0),N4,1))/(SMA(ABS(CLOSE-LC),N4,1))*100;
RSV0:=-(HHV(HIGH,N4)-CLOSE)/(HHV(HIGH,N4)-LLV(LOW,N4))*100;
LWR1:=SMA(RSV0,N1,1);
LWR2:=SMA(LWR1,N1,1);
BBI:=(MA(CLOSE,N1)+MA(CLOSE,N2)+MA(CLOSE,N3)+MA(CLOSE,N4))/4;
MTM:=CLOSE-REF(CLOSE,1);
MMS:=100*EMA(EMA(MTM,N2),N1)/EMA(EMA(ABS(MTM),N2),N1);
MMM:=100*EMA(EMA(MTM,N4),N3)/EMA(EMA(ABS(MTM),N4),N3);
BIAS:=(C-MA(C,N2))/MA(C,N2);
DIF:=(BIAS-REF(BIAS,16));
DBCD:=SMA(DIF,76,1);
MM:=MA(DBCD,5);
持股:=3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1);
下跌:=MA(持股,12);
MT:=C-REF(C,1);
ZLGJ:=100*EMA(EMA(MT,N3),N3)/EMA(EMA(ABS(MT),N3),N3);
MAZL:=MA(ZLGJ,5);
QJJ:=VOL/((HIGH-LOW)*2-ABS(CLOSE-OPEN));
XVL:=IF(CLOSE>OPEN,QJJ*(HIGH-LOW),IF(CLOSE<OPEN,QJJ*(HIGH-OPEN+CLOSE-LOW),VOL/2))+IF(CLOSE>OPEN,0-QJJ*(HIGH-CLOSE+OPEN-LOW),IF(CLOSE<OPEN,0-QJJ*(HIGH-LOW),0-VOL/2));
HSL:=(XVL/20)/1.15;
攻击流量:=((HSL*0.55+(REF(HSL,1)*0.33))+(REF(HSL,2)*0.22));
GJJ:=EMA(攻击流量,8);
LLJX:=EMA(攻击流量,3);
资金流量:=LLJX;
预选:=IF((DIFF2<DEA2 AND K<D AND RSI1<RSI2 AND LWR1<LWR2 AND CLOSE<BBI AND MMS<MMM AND DBCD<MM AND 持股<下跌 AND ZLGJ<MAZL AND 资金流量<0),1,0);
选股:=IF((CROSS(0.99,预选)),80,0);
STICKLINE(选股,0,80,0.1,1),COLORRED;
W1:=C=HHV(C,20);
W2:=BARSLAST(W1);
W3:=IF(W2>0,REF(C,W2),REF(C,W2));
W4:=CROSS(C,REF(W3,1));
XG:=C/REF(C,1)<1.01 OR REF(C,1)/C<1.01;
ZX:=(2*C+H+L)/4;
XG2:=HHV(ZX,3)/LLV(ZX,3)<1.01 AND HHV(ZX,20)/LLV(ZX,20)<1.15;
XG3:=C/H>0.995 AND O/L>0.995 AND C/REF(C,1)<1.05;
AA:=MA(C,1)/MA(REF(C,18),18)*100;
BB:=MA(FORCAST(AA,20),6);
黑码:=W4 AND COUNT(W4,5)=1 AND C/REF(C,1)<1.04 AND COUNT(XG,5)>3 AND REF(XG2,1)=1 AND XG3 AND COUNT(AA>BB,5)>3;
DRAWTEXT(黑码,50,'黑码'),COLOR00FFFF;
趋势:=3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1);
见底:=10;
短期底部:(CROSS(趋势,4))*80,COLORFFFFFF;
4.17版本以下的显示效果: