开仓条件:CROSS(C,MA(C,5))AND C>MA(C,5)*1.00074;//开仓信号
开仓参考价: ROUND( MAX(REF(MA(C,5),1),(MA(C,5)*1.00074)) );//取整后的开仓价
BUY( HOLDING=0 AND 开仓条件 AND C>开仓参考价, 1,MARKET);//开仓
//30个点止盈
IF C-AVGENTERPRICE>30*MINDIFF THEN BEGIN
SELL(1,HOLDING,MARKET);
END
//15个点止损
IF AVGENTERPRICE-C>15*MINDIFF THEN BEGIN
SELL(1,HOLDING,MARKET);
END