MA5:=MA(CLOSE,5);
MA5S:=MA(C,5);
MA13S:=MA(C,13);
MA20S:=MA(C,20);
MA30S:=MA(C,30);
MA60S:=MA(C,60);
MA120S:=SMA(C,120,1);
N:=10;
ZH520:=Abs(MA5S-MA20S)/MA20S*100<=N;
ZH530:=ABS(MA5S-MA30S)/MA30S*100<=N;
QSXS1:=MA5>REF(MA5S,1);
QSXS2:=MA20S>REF(MA20S,1);
QSXS3:=MA30S>REF(MA30S,1);
DTPL:=MA20S>MA30S AND MA30S>MA120S;
LYHT:=DTPL AND QSXS2 AND QSXS3 AND NOT(QSXS1) AND REF(QSXS1,1);
LYT:=DTPL AND QSXS2 AND QSXS3 AND COUNT(QSXS1,4)<=1;
GJHS:=C>MA5 AND ((QSXS1 AND NOT(REF(QSXS1,1))) OR C>REF(C,3));
LYKK:=GJHS AND (ZH520 OR ZH530) AND LYT;
DX:=100*EMA(EMA(mtm,6),6)/EMA(EMA(ABS(MTM),6),6);
买:(LYKK AND NOT(REF(LYKK,1)))*50;
MAA10:=MA(CLOSE,10);
MAA54:=MA(CLOSE,54);
PL1:=(((CLOSE - MAA54) / MAA54) < 0.1);
PL2:=(((CLOSE - MAA10) / MAA10) < 0.3);
偏离率:=(((PL1 = 1) AND (PL2 = 1)) * 0.2);
突破加仓:((((偏离率 = 0) AND (REF(偏离率,1) = 0.2)) AND (REF((COUNT((偏离率 = 0.2),10) = 10),1) = 1)) * 1);

