W1:=EMA(C,6);
W2:=EMA(W1,18);
W3:=MA(C,60);
K:="kdj.K#DAY"(9,3,3);
D:="kdJ.D#DAY"(9,3,3);
ZK:="KDJ.K#WEEK"(9,3,3);
ZD:="KDJ.D#WEEK"(9,3,3);
QSTJ:=W1>REF(W1,1) AND W1>=W2 AND C>O;{均线多头趋势}
KDTJ:= K>D AND K>REF(K,1) AND ZK>REF(ZK,5);{KD多头趋势}
volTJ:= V/REF(V,1)>1.5 AND V>REF(V,5) ;{量能多头趋势}
{横盘设定需要的参数}
N:=5;
CZL:=(REF(HHV(C,6)/LLV(C,6),1)-1)*100,COLORRED,NODRAW; {收盘价振幅}
CZF:=(REF(C,1)/REF(LLV(C,6),1)-1)*100,COLORYELLOW,NODRAW; {收盘价涨幅}
W1ZL:(REF(HHV(W1,N)/LLV(W1,N),1)-1)*100,COLORRED,NODRAW;
W1ZF:(REF(W1,1)/REF(LLV(W1,N),1)-1)*100,COLORYELLOW,NODRAW;
W2ZL:(REF(HHV(W2,N)/LLV(W2,N),1)-1)*100,NODRAW;
W2ZF:(REF(W2,1)/REF(LLV(W2,N),1)-1)*100,COLORYELLOW,NODRAW;
W3ZL:(REF(HHV(W3,N)/LLV(W3,N),1)-1)*100,NODRAW;
W3ZF:(REF(W3,1)/REF(LLV(W3,N),1)-1)*100,COLORYELLOW,NODRAW;
W2W3GL:=REF(Abs((W2-W3)*100/W3),1),COLORYELLOW,NODRAW;{W2W3乖离率}
{基本条件限制}
JBTJ:= COUNT(REF(W1,1)*1.01>REF(W2,1),5)>=4
AND COUNT(REF(W2,1)*1.02>REF(W3,1),5)>=4
AND W3*1.01>REF(W3,1)
AND CZL<8 AND CZF<5
AND C>REF(HHV(C,15),1) AND QSTJ AND KDTJ AND VOLTJ AND HSL>2.6;
W1HP:=CZL<4.5 AND CZF<2.6 AND W1ZL<2 AND W1ZF<1.8 AND COUNT(REF(L*0.98,1)=5 ;{收盘价严格横盘,W1W2略微放宽}
W2HP:=W2ZL<0.8 AND W2ZF<0.5 AND W1ZF<0.5;{W2线严格横盘,W1略微放宽}
W3HP:=W3ZF<0.66 AND W3ZL<0.88 AND W2ZF<1.2 AND W2W3GL<3 ;{W3线严格横盘,W2略微放宽}
HPTP:=W1HP OR W2HP OR W3HP;
DRAWICON(HPTP AND JBTJ,K,34);