MA5:=MA(C,5);
MA10:=MA(C,10);
MA20:=MA(C,20);
MA30:=MA(C,30);
MA120:=SMA(C,120,1);
ZH520:=ABS(MA5-MA20)/MA20*100<=10;
ZH530:=ABS(MA5-MA30)/MA30*100<=10;
QSXS1:=MA5>REF(MA5,1);
QSXS2:=MA20>REF(MA20,1);
QSXS3:=MA30>REF(MA30,1);
DTPL:=MA20>MA30 AND MA30>MA120;
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;
买:=LYKK AND NOT(REF(LYKK,1));
优选:买 AND COUNT((MA10>MA20),5)=5;
九毛八公式解读
MA5赋值:收盘价的5日简单移动平均 MA10赋值:收盘价的10日简单移动平均 MA20赋值:收盘价的20日简单移动平均 MA30赋值:收盘价的30日简单移动平均 MA120赋值:收盘价的120日[1日权重]移动平均 ZH520赋值:MA5-MA20的绝对值/MA20*100<=10 ZH530赋值:MA5-MA30的绝对值/MA30*100<=10 QSXS1赋值:MA5>1日前的MA5 QSXS2赋值:MA20>1日前的MA20 QSXS3赋值:MA30>1日前的MA30 DTPL赋值:MA20>MA30 AND MA30>MA120 LYT赋值:DTPL AND QSXS2 AND QSXS3 AND 统计4日中满足QSXS1的天数<=1 GJHS赋值:收盘价>MA5 AND ((QSXS1 AND 取反) OR 收盘价>3日前的收盘价) LYKK赋值:GJHS AND (ZH520 OR ZH530) AND LYT 买赋值:LYKK AND 取反 输出优选:买 AND 统计5日中满足(MA10>MA20)的天数=5