if c<oo-80*DYNAINFO(208) and n3=0 and time>tt3+15 then begin
tbuy(1,44,mkt);
n3:=1;
tt3>time;
end
源码就是这样的
那么就请咨询下写这代码的人,实在是看不出time>tt3+15 和 一天周期之间有什么相关性
低于开盘价80跳,买入44手,并且这一天内只成交这一次
这个需要全局变量来控制,一天一次
GLOBALVARIABLE:n=0,tt=0;
if l<open-80*mindiff and n=0 and time<>tt then begin
tbuy(1,1,mkt);
n:=1;
tt:=time;
end
然后代码最后要写上这个,重置变量
if time=closetime(0) then begin
n:=0;
tt:=0;
end
[此贴子已经被作者于2015/11/2 9:40:39编辑过]
GLOBALVARIABLE:n1=0,n2=0,n3=0;
GLOBALVARIABLE:tt1=0,tt2=0,tt3=0;
oo:=VALUEWHEN(todaybar=1,o);
if l<open-20*mindiff and n1=0 and time<>tt1 then begin
tbuy(1,11,mkt);
n1:=1;
tt1:=time;
end
if c<oo-60*mindiff and n2=0 and time<>tt2 then begin
tbuy(1,22,mkt);
n2:=1;
tt2:=TIME;
END
if c<oo-80*mindiff and n3=0 and time<>tt3 then begin
tbuy(1,44,mkt);
n3:=1;
tt3:=time;
end
if time=closetime(0) then begin
n:=0;
tt:=0;
end
是这样的是吗,老师?、
if time=closetime(0) then begin
n1:=0;
tt1:=0;
end
老师,比如一个策略上面有三个平多条件,第一个写成PD,第二个写成PD2,滴三个写成PD3,可以吗??