if holding=0 then begin
if tmp>0 then
buy(1,1,marketr);
end
if holding=0 then begin
if tmp<0 then
buyshort(1,1,marketr);
end
if holding>0 then begin
if tmp<0 then begin
sell(1,holding,marketr);
buyshort(1,1,marketr);
end
end
if holding<0 then begin
if tmp>0 then begin
sellshort(1,holding,marketr);
buy(1,1,marketr);
end
end
If ((C-Enterprice)/Enterprice)*100>=9 AND HOLDING<0 then begin
空损:SellShort(1,0,marketr);
End
If ((Enterprice-C)/C)*100>=9 AND HOLDING>0 then begin
多损:Sell(1,0,marketr);
End