cc:=CALLSTOCK(STKLABEL,VTCLOSE,6);
c5:=CALLSTOCK(STKLABEL,VTCLOSE,2);
jx5:=ma(cc,5);
jx20:=ma(cc,20);
jx5f5:=ma(c5,5);
jx5f20:=ma(c5,20);
sc:=cross(jx5f5,jx5f20);
xc:=cross(jx5f20,jx5f5);
money:=holding*c;
total0:=money+cash(0);
total1:=money+cash(1);
if jx5>jx20 then
begin
sellshort(holding<0,0,thisclose);
buy(sc and holding=0,40%,thisclose);
end
if jx20>jx5 then
begin
sell(holding>0,0,thisclose);
buyshort(xc and holding=0,40%,thisclose);
end
if ENTERPRICE*1.3>=h and holding>0 then;
begin
sell(holding>entervol/2,entervol/2,thisclose);
end
if ENTERPRICE*0.7<=l and holding<0 then;
begin
sellshort(holding<entervol/2,entervol/2,thisclose);
end
if ENTERPRICE*1.3>=c and holding>0 then;
begin
sell(holding>0,holding/2,thisclose);
end
if ENTERPRICE*1.3<=c and holding<0 then;
begin
sellshort(holding<0,holding/2,thisclose);
end
改这样试试