ma60:=ma(O,60);MAUP:=ma60>ref(ma60,1);
MADN:=ma60<ref(ma60,1);
if c>ref(c,1) and ref(c,1)<ref(c,2) and MAUP then
begin
sellshort(1,holding,marketr);
buy(1,1,marketr);
END
if c<ref(c,1) and ref(c,1)>ref(c,2) and MADN then
begin
sell(1,holding,marketr);
buyshort(1,1,marketr);
END
就加进去就行了。