里面有 if holding=0 then begin if tmp<=0 then buy(1,1,limitr,close); end if holding=0 then begin if tmp>0 then buyshort(1,1,limitr,close); end if holding>0 then begin if tmp>0 then begin sell(1,holding,limitr,close); buyshort(1,1,limitr,close); end end if holding<0 then begin if tmp<=0 then begin sellshort(1,holding,limitr,close); buy(1,1,limitr,close); end end 這個順序和你們要求的不一樣啊