如果最新的動(dòng)態(tài)權(quán)益低于某個(gè)值或者目前賬戶(hù)總資產(chǎn)的某個(gè)百分?jǐn)?shù),則賬戶(hù)持倉(cāng)全部清空并且策略不再開(kāi)倉(cāng),這個(gè)應(yīng)該怎么寫(xiě)呢?
VARIABLE:n:=0;
if 開(kāi)多條件 and n=0 then buy(holding=0,1,market);
if 開(kāi)空條件 and n=0 then buyshort(holding=0,1,market);
if asset<x then begin
sell(holding>0,holding,market);
sellshort(holding<0,holding,market);
n:=1;
end