移動止盈怎么寫
作者:金字塔 來源:cxh99.com 發布時間:2015年07月04日
- 咨詢內容:
盈利達到0.5%后最大盈利回跌n%怎么寫,求教高手,謝謝
- 金字塔客服:
盈利達到0.5%后最大盈利回跌n%止盈該怎么寫,求教高手,謝謝
- 用戶回復:
VARIABLE:x=0,m=0;
//多頭
hh:=hhv(h,enterbars+1);
t1:hh-ENTERPRICE>0.05*enterprice;
t2:hh-l>=0.0n*hh;
if t1 then x:=1;
if x=1 and t2 and holding>0 then begin
sell(1,holding,market);
x:=0;
end
//空頭
ll:=llv(l,enterbars+1);
k1:=enterprice-ll>0.05*enterprice;
k2:h-ll>=0.0n*ll;
if k1 then m:=1;
if m=1 and k2 and holding<0 then
begin
sellshort(1,holding,market);
m:=0;
end
- 網友回復:
感謝版主指教