[PEL] 复制代码 INPUT:N(100,1,600,1);
emaN:EMA(C,N);
kd:cross(emaN,c) and ref(all(c>emaN,5),1);
kk:cross(c,emaN) and ref(all(c<emaN,5),1);
IF C-AVGENTERPRICE>20*MINDIFF THEN BEGIN
空止损:SELLSHORT(1,HOLDING,MARKET);
END
IF AVGENTERPRICE-C>20*MINDIFF THEN BEGIN
多止损:SELL(1,HOLDING,MARKET);
END
duomaxProfit:=HHV(H,ENTERBARS+1)-AVGENTERPRICE;
kongmaxProfit:=AVGENTERPRICE-LLV(L,ENTERBARS+1);
if duomaxProfit>=20*MINDIFF and (HHV(H,ENTERBARS+1)-c)>=15*MINDIFF then 多移动:SELL(1,holding,MARKET);
if kongmaxProfit>=20*MINDIFF and (c-LLV(L,ENTERBARS+1))>=15*MINDIFF then 空移动:SELLSHORT(1,holding,MARKET);
buy(kd and holding=0,1,market);
buyshort(kk and holding=0,1,market);
|