(来源:文华财经)
NNN:=NN;//定义距离均线参数,可修改,NN=2
CC001:=CROSSUP(CLOSE,M1-NN*MINPRICE);//价格向上突破均线下方2个点开空
DD001:=CROSSDOWN(CLOSE,M1+(NN-1)*MINPRICE);//价格向下突破均线上方1个点开多
CC002:=REF(CLOSE,1)<M1 AND REF(CLOSE,2)<M1 AND REF(CLOSE,3)<M1;//前3日收盘价小于均线
DD002:=REF(CLOSE,1)>M1 AND REF(CLOSE,2)>M1 AND REF(CLOSE,3)>M1 ; //前3日收盘价大于均线
CC001 AND CC002 AND BKVOL=0 AND (开仓 AND 不开仓 ),SK(XD);//开空