请教:ss:EXTGBDATA('ss'),linethick0;
if r1>=1 and t1 and dt<=2 then
begin
if kd then
begin
if hold<0 then begin
tsellshort(1,1,mkt,0,0);
hold:=0;
end
if hold=0 then begin
tbuy(tholding<ss,1,mkt,0,0);
hold:=1;
end
end
if kk then
begin
if hold>0 then begin
tsell(1,1,mkt,0,0);
hold:=0;
end
if hold=0 then begin
tbuyshort(-tholding<ss,1,mkt,0,0);
hold:=-1;
end
end
end
以下是引用jinzhe在2014/7/4 16:26:34的发言:
有3个条件
kk, hold=0, -tholding<ss
其中有一个不成立
kk肯定成立的,
hold=0也是肯定,因为假如hold>0,则会进入平仓后赋值hold:=0的,
至于-tholding<ss,也是成立的,ss:=20,而当时的-tholding还远小于20,还在10以下呢!
不要那么肯定,有一个不成立,不要怀疑计算机的计算能力
你用debugfile调试输出一下各个条件