MTM:=C-REF(C,1);
DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);
YXF:=IF(LLV(DX,2)=LLV(DX,7) AND COUNT(DX<0,2) AND CROSS(DX,MA(DX,2)),1,0);
加仓:=IF(FILTER(YXF=1,5),20,0);
买:=(ZIG(3,5)>REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)<=REF(ZIG(3,5),2)) AND (REF(ZIG
(3,5),2)<=REF(ZIG(3,5),3));
卖:=(ZIG(3,5)<REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)>=REF(ZIG(3,5),2)) AND (REF(ZIG
(3,5),2)>=REF(ZIG(3,5),3));
P1:=5;
P2:=4;
VARA:=LLV(LOW,P1);
VARB:=HHV(HIGH,P1);
K:= EMA((CLOSE-VARA)/(VARB-VARA)*100,P2);
D:= EMA(0.667*REF(K,1)+0.333*K,2);
BBIS:=(MA(CLOSE,2)+MA(CLOSE,3)+MA(CLOSE,5))/3;
XG:加仓=20 OR CROSS(K,D);
ZIG(3,5). 使用了这个未来函数,但是请仔细参看我的运用语句:
买:=(ZIG(3,5)>REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)<=REF(ZIG(3,5),2)) AND (REF(ZIG(3,5),2)<=REF(ZIG(3,5),3));
卖:=(ZIG(3,5)<REF(ZIG(3,5),1)) AND (REF(ZIG(3,5),1)>=REF(ZIG(3,5),2)) AND (REF(ZIG(3,5),2)>=REF(ZIG(3,5),3));
有很多条件所以几乎不会漂移。
如果有顾虑可替换成:
买:=(CLOSE>REF(CLOSE,1)) AND (REF(CLOSE,1)<=REF(CLOSE,2)) AND (REF(CLOSE,2)<=REF(CLOSE,3));
卖:=(CLOSE<REF(CLOSE,1)) AND (REF(CLOSE,1)>=REF(CLOSE,2)) AND (REF(CLOSE,2)>=REF(CLOSE,3));
绝对没问题