N:=65;
MA5:=MA(CLOSE,5);
MA21:=MA(CLOSE,21);
MA65:=MA(CLOSE,N);
多头:=COUNT(MA21>MA65,10)=10;
GX:=MAX(MA5,MAX(MA21,MA65));
DX:=MIN(MA5,MIN(MA21,MA65));
粘合:=Abs(GX/DX-1)*100<=15;
DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
macd:=2*(DIFF-DEA);
庄股:=COUNT(MacD<0,10)=10;
目标:=IF(多头 AND 粘合 AND 庄股,5,0);
出击:=IF(crOSS(0.1,目标) AND CROSS(MACD,0),8,0);
买:出击>0;