QWX1:=HHV(CLOSE,30);
QWX2:=LLV(CLOSE,30);
QWX3:=CONST((QWX1+QWX2)/2);
{MACD}
DIF:=(EMA(CLOSE,12)-EMA(CLOSE,26))*2+QWX3,COLORWHITE;
DEA:=EMA(DIF,9),COLORYELLOW;
MACD:=(DIF-DEA)*2+QWX3,COLORYELLOW,LINETHICK2;
DRAWBAND(MACD,RGB(116,2,116),QWX3,RGB(86,76,58));
A001:=CLOSE-REF(CLOSE,6);
A002:=MA(A001,6);
A003:=((CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9)))*100;
A004:=SMA(A003,3,1);
A005:=SMA(A004,3,1);
A006:=EMA((3*A004-2*A005),2);
A007:=(HIGH+LOW+CLOSE)/3;
A008:=((A007-MA(A007,14))/(0.015*AVEDEV(A007,14)))/2;
A009:=(A008+(EMA(((0-(100*(HHV(HIGH,14)-CLOSE)/(HHV(HIGH,14)-LLV(LOW,14))))+100)/100,3)*200-100))/2;
A010:=A009-REF(A009,14);
A011:=A009-REF(A009,26);
A012:=(A009+A010+A011)/3;
KKM:=EMA(A012,4);
A013:=HHV(HIGH,34);
A014:=(2*CLOSE+HIGH+LOW)/4;
A015:=LLV(LOW,34);
A016:=EMA(((A014-A015)/(A013-A015))*100,13);
A017:=EMA(0.667*REF(A016,1)+0.333*A016,2);
KKMD:=A016-A017>1 AND A016<30 AND A017<30;
KKML:=A016-A017<0 AND A016>80 AND A017>80 AND REF(A016-A017,1)>0;
KKMQ:=COUNT(A016-A017>0,2)=2;
KKAL:=(A016-A017)<0;
生命线:MA(CLOSE,20),LINETHICK2,COLOR0000FF;
取舍线:MA(CLOSE,10),LINETHICK2,COLOR00FF00;
STICKLINE(CLOSE>OPEN,OPEN,LOW,0.0,0 ),COLOR0000FF;
STICKLINE(CLOSE>OPEN,CLOSE,HIGH,0.0 ,0 ),COLOR0000FF;
STICKLINE(OPEN>=CLOSE,CLOSE,LOW,0.0 ,0 ),COLOR00FF00;
STICKLINE(OPEN>=CLOSE,OPEN,HIGH,0.0 ,0 ),COLOR00FF00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,3.0,0 ),COLORFF7700;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,2.5,0 ),COLORFF9900;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,2.0,0 ),COLORFFBB00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,1.5,0 ),COLORFFCC00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,1.0,0 ),COLORFFDD00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,0.5,0 ),COLORFFEE00;
STICKLINE(OPEN>=CLOSE ,CLOSE ,OPEN,0.0,0 ),COLORFFFF00;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3.0,0) ,COLOR000055;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2.5,0) ,COLOR000066;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2.0,0) ,COLOR000077;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1.5,0) ,COLOR000099;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1.0,0) ,COLOR0000BB;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,0.5,0) ,COLOR0000DD;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,0.0,0) ,COLOR0000FF;
VAR9Q:=C= HHV(C,4)AND (REF(C,1)>=REF(C,2) OR REF(C,1)>=REF(C,3)) OR REF(C,1)=HHV(C,4) AND CLOSE>=REF(C,2) OR REF(C,2)=HHV(C,4) AND REF(C,3)=LLV(C,4) AND C>=REF(C,1) OR REF(C,3)=HHV(C,4) AND C>=REF(C,1) AND C>=REF(C,2);
VARAQ:=C=HHV(C,4) AND REF(C,1)=LLV(C,4);
VARBQ:=C=LLV(C,4) AND (REF(C,1)<REF(C,2) OR REF(C,1)<REF(C,3)) OR REF(C,1)=LLV(C,4) AND C<REF(C,2) OR REF(C,2)=LLV(C,4) AND REF(C,1)<>HHV(C,4) AND C<REF(C,1) OR REF(C,3)=LLV(C,4) AND C<REF(C,1) AND C<REF(C,2);
VARCQ:=REF(C,1)=LLV(C,4) AND C>=REF(C,2) OR REF(C,2)=LLV(C,4) AND REF(C,1)<=REF(C,3) AND REF(C,2)<REF(C,4) AND C>=REF(C,1);
VARDQ:=REF(C,1)=HHV(C,4) AND C<REF(C,2) OR (REF(C,2)=HHV(C,4) AND REF(C,1)>REF(C,3) OR REF(C,3)=HHV(C,4) AND REF(C,1)>REF(C,2)) AND REF(C,2)>=REF(C,4) AND C<REF(C,1);
红:=VAR9Q;
STICKLINE(VAR9Q,C,(O+C)/2,3.0,0),COLOR000055;
STICKLINE(VAR9Q,C,(O+C)/2,2.5,0),COLOR000066;
STICKLINE(VAR9Q,C,(O+C)/2,2.0,0),COLOR000077;
STICKLINE(VAR9Q,C,(O+C)/2,1.5,0),COLOR000099;
STICKLINE(VAR9Q,C,(O+C)/2,1.0,0),COLOR0000BB;
STICKLINE(VAR9Q,C,(O+C)/2,0.5,0),COLOR0000DD;
STICKLINE(VAR9Q,C,(O+C)/2,0.0,0),COLOR0000FF;
粉:=VARAQ;
STICKLINE(VARAQ,C,(O+C)/2,3.0,0),COLORFF11FF;
STICKLINE(VARAQ,C,(O+C)/2,2.5,0),COLORFF33FF;
STICKLINE(VARAQ,C,(O+C)/2,2.0,0),COLORFF55FF;
STICKLINE(VARAQ,C,(O+C)/2,1.5,0),COLORFF77FF;
STICKLINE(VARAQ,C,(O+C)/2,1.0,0),COLORFF99FF;
STICKLINE(VARAQ,C,(O+C)/2,1.5,0),COLORFFBBFF;
STICKLINE(VARAQ,C,(O+C)/2,0.0,0),COLORFFDDFF;
灰:=VARBQ;
STICKLINE(VARBQ,C,(O+C)/2,3.0,0),COLOR333333;
STICKLINE(VARBQ,C,(O+C)/2,2.5,0),COLOR555555;
STICKLINE(VARBQ,C,(O+C)/2,2.0,0),COLOR777777;
STICKLINE(VARBQ,C,(O+C)/2,1.5,0),COLOR999999;
STICKLINE(VARBQ,C,(O+C)/2,1.0,0),COLORBBBBBB;
STICKLINE(VARBQ,C,(O+C)/2,0.5,0),COLORDDDDDD;
STICKLINE(VARBQ,C,(O+C)/2,0.0,0),COLORFFFFFF;
绿:=VARCQ;
STICKLINE(VARCQ,O,(O+C)/2,3.0,0),COLOR003300;
STICKLINE(VARCQ,O,(O+C)/2,2.5,0),COLOR005500;
STICKLINE(VARCQ,O,(O+C)/2,2.0,0),COLOR007700;
STICKLINE(VARCQ,O,(O+C)/2,1.5,0),COLOR009900;
STICKLINE(VARCQ,O,(O+C)/2,1.0,0),COLOR00BB00;
STICKLINE(VARCQ,O,(O+C)/2,0.5,0),COLOR00DD00;
STICKLINE(VARCQ,O,(O+C)/2,0.0,0),COLOR00FF00;
蓝:=VARDQ;
STICKLINE(VARDQ,O,(O+C)/2,3.0,0),COLORFF1100;
STICKLINE(VARDQ,O,(O+C)/2,2.5,0),COLORFF3300;
STICKLINE(VARDQ,O,(O+C)/2,2.0,0),COLORFF5500;
STICKLINE(VARDQ,O,(O+C)/2,1.5,0),COLORFF7700;
STICKLINE(VARDQ,O,(O+C)/2,1.0,0),COLORFF9900;
STICKLINE(VARDQ,O,(O+C)/2,0.5,0),COLORFFBB00;
STICKLINE(VARDQ,O,(O+C)/2,0.0,0),COLORFFDD00;
DRAWTEXT(FILTER(KKMD,30),L-0.1,'最佳买入时机'),COLOR00FFFF;
DRAWTEXT(FILTER(KKML,30),H+0.1,'最佳卖出时机'),COLORFFFF00;
DRAWTEXT(FILTER(KKMQ,30),C,'持仓区'),COLOR00FF00;
DRAWTEXT(FILTER(KKAL,30),H+0.1,'空仓区'),COLORFF8080;
DRAWTEXT(FILTER(CLOSE/REF(CLOSE,1)>INDEXC/REF(INDEXC,1),30),L-0.3,'该股强于大盘'),COLORFF00FF;
{DRAWTEXT(CROSS(MA(CLOSE,5),MA(CLOSE,10)),L-0.5,'可出手'),COLORFF00FF;
DRAWTEXT(CROSS(MA(CLOSE,10),MA(CLOSE,5)),H+0.5,'收手了'),COLORFF0000;}
DRAWTEXT(FILTER(KKM>EMA(KKM,4) AND KKM>REF(KKM,1),30),L-0.3,'快速介入');
DRAWTEXT(FILTER(KKM<EMA(KKM,4) AND KKM<REF(KKM,1),30),H+0.3,'风险较大');
DRAWTEXT(FILTER(KKM>EMA(KKM,4) AND KKM<REF(KKM,1),30),H+0.1,'休息观望~'),COLORAA8800;
DRAWTEXT(FILTER(KKM<EMA(KKM,4) AND KKM>REF(KKM,1),30),L-0.1,'有防御能力'),COLORAA00AA;
{解盘}
AAA:=CONST(HHV(H,90));
A74:=MA(CLOSE,20);
A75:=(CLOSE > MA(CLOSE,5));
A76:=(MA(CLOSE,5) > MA(CLOSE,10));
A77:=(CLOSE > MA(CLOSE,10));
A78:=(MA(CLOSE,5) > MA(CLOSE,20));
A79:=(CLOSE > MA(CLOSE,20));
A710:=REF(A74,1);
A711:=(A74 > A710);
AVX:=(((((IF(A75,10,(0 - 10)) + IF(A76,10,(0 - 10))) + IF(A77,10,(0 - 10)))
+ IF(A78,10,(0 - 10))) + IF(A79,10,(0 - 10))) + IF(A711,10,(0 - 10)));
DSLX:=(CLOSE / INDEXC);
DSLX1:=MA(DSLX,5);
DSLX2:=MA(DSLX,10);
V1:=MA(VOL,5);
V2:=MA(VOL,10);
T1:=CONST(IF(C<200 AND ((CROSS(AVX,1) AND (V1 >= V2)) AND (DSLX >= DSLX1)),1,0));
T2:=CONST(IF(C<200 AND ((CROSS(AVX,1) AND (V1 < V2)) AND (DSLX >= DSLX1)),1,0));
T3:=CONST(IF(C<200 AND ((CROSS(AVX,1) AND ( |