[PEL] 复制代码 lastC:=CALLSTOCK('',vtCLOSE,6,-1);//昨日收盘价
kd:TODAYBAR=1 and o>lastC;
kk:TODAYBAR=1 and o<lastC;
buy(kd and holding=0,10,market);
buyshort(kk and holding=0,10,market);
if time=35000 then
begin
sell(1,holding,market);
sellshort(1,holding,market);
end
maxprofit1:=hhv(h,ENTERBARS)-AVGENTERPRICE;//多头最大盈利
maxprofit2:=AVGENTERPRICE-llv(l,ENTERBARS);
if (c-AVGENTERPRICE)>=200*MINDIFF and holding>0 then dzy:sell(1,holding,market);
if maxprofit1>=30*MINDIFF and c-AVGENTERPRICE<=10*MINDIFF then dzy2:sell(1,holding,market);//最大盈利大于30 后从高点回落到盈利10点以内
if (AVGENTERPRICE-c)>=30*MINDIFF and holding>0 then dzs:sell(1,holding,market);
if (AVGENTERPRICE-c)>=200*MINDIFF and holding<0 then kzy:sellshort(1,holding,market);
if maxprofit2>=30*MINDIFF and AVGENTERPRICE-c<=10*MINDIFF then kzy2:sellshort(1,holding,market);
if (c-AVGENTERPRICE)>=30*MINDIFF and holding<0 then kzs:sellshort(1,holding,market); |