variable:a=8;
variable:qy=0;
if 平多条件 and holding>0 then begin
sell......;
buyshort.......;
if asset>qy then begin
qy:=asset;
a:=ss;
end
if qy<>0 and (qy-asset)/qy>0.1 then a:=0.8*a;
if qy<>0 and (qy-asset)/qy>0.2 then a:=0.64*a;
end
if 平空条件 and holding>0 then begin
sellshort......;
buy.......;
if asset>qy then qy:=asset;
if qy<>0 and (qy-asset)/qy>0.1 then a:=0.8*a;
if qy<>0 and (qy-asset)/qy>0.2 then a:=0.64*a;
end
只能写缩的,变回去的定义不了