//交易系统
IF (HOLDING=0) THEN BEGIN
//多单入场
IF 开多条件 THEN BEGIN
BUY(HOLDING=0,1,MARKET);
//止损
IF (LOW<=ENTERPRICE-STOPLOSS*MINDIFF) THEN
SELL(1,HOLDING,LIMITR,ENTERPRICE-STOPLOSS*MINDIFF);
END
//空单入场
IF 开空条件 THEN BEGIN
BUYSHORT(HOLDING=0,1,MARKET);
//止损
IF (HIGH>=ENTERPRICE+STOPLOSS*MINDIFF) THEN
SELLSHORT(1,HOLDING,LIMITR,ENTERPRICE+STOPLOSS*MINDIFF);
END
END
IF (HOLDING<0) THEN BEGIN
IF 开多条件 THEN BEGIN
SELLSHORT(HOLDING<0,0,MARKET),ORDERQUEUE;
BUY(HOLDING=0,1,MARKET),ORDERQUEUE;
END
END
IF (HOLDING>0) THEN BEGIN
IF 开空条件 THEN BEGIN
SELL(HOLDING>0,0,MARKET),ORDERQUEUE;
BUYSHORT(HOLDING=0,1,MARKET),ORDERQUEUE;
END
END
以上为交易部分的代码,请教版主如何调整,在止损触发平仓之后,再次满足开仓条件,继续进行开仓操作,如果再止损,仍旧按照止损---再开仓的动作,直到出现下边的反转信号,进入之前的开仓---止损(如果被打到)---开仓---反手的循环
谢谢版主,辛苦了! 自己试了很久,也没成功,不然不会麻烦到版主
[此贴子已经被作者于2013/12/30 20:40:28编辑过]