560系统

INPUT:TOPVALUE(70,65,95,1),BOTTOMVALUE(30,5,35,1);
RUNMODE:0;
VARIABLE:MAXPROFIT=0;
WIN_NOW:=0;WIN_BACK:=0;//用于计算盈利的中间变量

VAR5:=LLV(LOW,26);
VAR6:=HHV(HIGH,34);
VAR7:=EMA((CLOSE-VAR5)/(VAR6-VAR5)*4,4)*25;
BUY("dqs.H1#MIN60">"dqs.H2#MIN60" AND "hm.VAR7#MIN5"<BOTTOMVALUE AND HOLDING=0,50%,THISCLOSE);
SELL("dqs.H1#MIN60"<"dqs.H2#MIN60" AND HOLDING>0,HOLDING,MARKET);
BUYSHORT("dqs.H1#MIN60"<"dqs.H2#MIN60" AND "hm.VAR7#MIN5">TOPVALUE AND HOLDING=0,50%,THISCLOSE);
SELLSHORT("dqs.H1#MIN60">"dqs.H2#MIN60" AND HOLDING<0,HOLDING,MARKET);

//回撤止盈
IF ENTERBARS>0 THEN BEGIN
	WIN_NOW:=(C-ENTERPRICE)/ENTERPRICE*100;
	IF WIN_NOW>MAXPROFIT THEN MAXPROFIT:=WIN_NOW;
	WIN_BACK:=(MAXPROFIT-WIN_NOW)/MAXPROFIT*100;
SELL(WIN_BACK>25 AND WIN_NOW>10 AND HOLDING>0,HOLDING,MARKET);//止盈多头
SELLSHORT(WIN_BACK>25 AND WIN_NOW>10 AND HOLDING<0,HOLDING,MARKET);//止盈空头
END


持仓:holding,linethick0;
资产:asset,noaxis;
可用现金:cash(0),linethick0;

 

最近写的一份简单的系统(命名为560系统),作为备份,以后再完善

你可能感兴趣的:(系统)