波段怎么定义?
ma5:ma(c,5); ma10:ma(c,10); jc:cross(ma5,ma10); buy(jc and holding=0,手数,marketr); ll:=ref(llv(l,10),enterbars+1); hh:=hhv(h,enterbars+1); if c<=hh-(1-0.68)*(hh-ll) and holding>0 then sell(1,50%,marketr); if c<=hh-0.5*(hh-ll) and holding>0 then sell(1,holding,marketr) 这个公式里,怎么加上,10根k线后,突破高点加仓1次,并且1天只能加仓一次, 止损条件的时候,加上4根k线后再执行止损条件,谢谢老师 |
编写中,但是建议楼主学习下编写教程:http://www.weistock.com/bbs/dispbbs.asp?boardid=16&Id=55132
VARIABLE:n=0;
ss:=1;//手数
ma5:ma(c,5);
ma10:ma(c,10);
jc:cross(ma5,ma10);
buy(jc and holding=0,ss,marketr);
if n=0 and enterbars>=10 and h>ref(hhv(h,enterbars),1) and holding>0 then begin //加仓
buy(1,1,marketr);
n:=1;
end
ll:=ref(llv(l,10),enterbars+1);
hh:=hhv(h,enterbars+1);
if c<=hh-(1-0.68)*(hh-ll) and holding>0 and enterbars>=4 then sell(1,50%,marketr);
if c<=hh-0.5*(hh-ll) and holding>0 and enterbars>=4 then sell(1,holding,marketr);
if time=closetime(0) then n:=0;