如果最新的动态权益低于某个值或者目前账户总资产的某个百分数,则账户持仓全部清空并且策略不再开仓,这个应该怎么写呢?
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