-- 作者:hksl1023
-- 发布时间:2016/1/29 20:53:27
-- 这样写对吗
平仓资金权益从最高点回撤小于10%,开仓3手
平仓资金权益从最高点回撤大于10% ,开仓1手
variable:n=3;
if kd and holding=0 then buy(1,n,marketr);
hh:=hhv(asset,enterbars+1);
if pd and holding>0 then begin
sell(1,0,marketr);
if asset<hh*(1-0.1) then n:=3; if asset>=hh*(1-0.1)then n:=1;
end
|