N:=20;M:=10;
A1:=EMA(CLOSE,12)-EMA(CLOSE,26);
A2:=EMA(A1,9);
MD:=(A1-A2)*2;
买进条件:A1>REF(A1,1) AND REF(A1,1)<REF(A1,2) AND VOL>REF(VOL,1)*1.2;
H1:HHV(H,n),LINETHICK0;
n日涨幅:IF(REF(买进条件,n),(H1-REF(C,n))/REF(C,n)*100,0);
DRAWTEXT(n日涨幅,2,'n天最高上涨');
总次数:SUM(买进条件,0)/1,LINETHICK0;
B1:BACKSET(n日涨幅>m,n+1),LINETHICK0;
B2:=买进条件 AND B1;
盈利次数:SUM(B2,0),LINETHICK0;
C1:BACKSET(n日涨幅<0,n+1),LINETHICK0;
C2:=买进条件 AND C1;
亏损次数:SUM(C2,0),LINETHICK0;
盈利比:盈利次数/总次数*100,LINETHICK0;
H10:10,POINTDOT;