如果最新的動態權益低于某個值或者目前賬戶總資產的某個百分數,則賬戶持倉全部清空并且策略不再開倉,這個應該怎么寫呢?
VARIABLE:n:=0;
if 開多條件 and n=0 then buy(holding=0,1,market);
if 開空條件 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