DA:=6;FA:=5;CT:=1;P:=0;N:=3;
NS:=IF((HHV(Abs(((HHV(CLOSE,DA)/LLV(CLOSE,DA))-1)),DA)>(10/100)),3,DA);
N1:=IF((MINUTE=5),(NS*48),IF((MINUTE=15),(NS*16),IF((MINUTE=30),(NS*8),IF((MINUTE=60),(NS*4),NS))));
MM:=IF(((P=0) OR (vol=0)),MA(CLOSE,N1),((SUM(AMOUNT,N1)/SUM(VOL,N1))/100));
M1:=REF(MM,1);
买入:IF(crOSS(CLOSE,M1),M1,0);