這個要用全局變量的
variable:bj=0;
if 開多條件 and holding=0 and bj=0 then begin
buy(1,1,marketr);
bj:=1;
end
if holding>0 and bj=1 and 平多條件 then begin
sell(1,0,marketr);
if time=closetime(0) then bj:=0;