MA60:=MA(CLOSE,60);
生命线:=MA(CLOSE,20);
SZ1:=(REF((C 生命线),3) EVERY((C = 生命线),3));{上涨浪确立}
SZ2:=BARSLAST(SZ1),NODRAW;{最后的上涨浪确立距今天数}
XD1:=(REF((C 生命线),3) EVERY((C = 生命线),3));{下跌浪确立}
XD2:=BARSLAST(XD1);{最后的下跌浪确立距今天数}
SZ3:=CROSS(XD2,SZ2);{当前进入上涨浪}
XD3:=CROSS(SZ2,XD2);{当前进入下跌浪}
SZ4:=(BARSLASTCOUNT(BACKSET(SZ3,4)) = 1);{上涨浪首日的定位}
XD4:=(BARSLASTCOUNT(BACKSET(XD3,4)) = 1);{下跌浪首日的定位}
SZL:=BARSLASTCOUNT((BARSLAST(SZ4) = BARSLAST(XD4)));{上涨浪持续区间}
XDL:=BARSLASTCOUNT((BARSLAST(XD4) = BARSLAST(SZ4)));{下跌浪持续区间}
ZDD:=FILTER((LLV(L,XDL) = L),SZL);{波段中过滤掉上涨区间中的二次低点}
ZGD:=FILTER((HHV(H,SZL) = H),XDL);{波段中过滤掉下跌区间中的二次高点}
Z1:=BARSLAST(XD4);{最后的下跌浪首日距今天数}
Z2:=BARSLAST(SZ4);{最后的上涨浪首日距今天数}
LL:=LLV(L,(Z1 + 1)),NODRAW;{最后一个下跌浪区间的低点}
LC:=LLV(C,(Z1 + 1));
HH:=HHV(H,(Z2 + 1)),NODRAW;{最后一个上涨浪区间的高点}
CC:=HHV(C,(Z2 + 1)),NODRAW;
DDD:=REF(HH,Z1);{前一波上涨浪区间最高点}
LL1:=REF(LL,Z2),NODRAW;{本波下跌浪区间最低点}
LLL:=REF(LL1,Z1),NODRAW;{前一波下跌浪区间最低点}
小盘:=CAPITAL/100 350000;
前一波涨幅:=(((DDD - LLL) / LLL) * 100),NODRAW;
跌幅:=(((DDD - LL) / DDD) * 100),NODRAW;
FE0:=RANGE( 前一波涨幅,25,150) ;
FE1:=(跌幅 = 15) ,NODRAW;
HCTJ:=REF(COUNT(BETWEEN(L/MA(C,60),0.99,1.01), XDL),1)
XDLTS:=REF(COUNT(C 生命线,XDL) =12,1);
JD:=ATAN((MA(C,60)/(REF(MA(C,60),1))-1)*100)*180/3.1416,NODRAW;
HC60:=COUNT(HCTJ AND XDLTS,Z2) AND REF(JD,1) =5 AND EVERY(C (MA(C,60)),Z1);
{12天内回踩过60均线1%,但收盘不破60均线,}
BP:=REF(COUNT((C MA60), XDL),1)
HPTJ:=REF(COUNT(BETWEEN(C/MA(C,60),0.98,1.065), XDL),1) =10 ;
HP60:=COUNT(HPTJ,XDL) 0 AND REF(JD,1) =5 AND BP;
{在60均线横盘 }
选股前提:EXIST (FE0 ,Z2 ) AND EXIST (FE1 ,Z1 ) AND LL LLL AND (HC60 OR HP60) AND 小盘;
回踩60破绽: 选股前提 AND (C O AND CROSS(C,生命线));