if tbuyholding(1)>0 then
begin
if c>=(TENTERPRICE+zyd) then
begin
tsell(tholding>0,tbuyholding(1),lmt,tenterprice+zyd);
rbmark:=0;
end;
if c<=(tenterprice-zsd) then
begin
tsell(tholding>0,tbuyholding(1),lmt,tenterprice-zsd);
rbmark:=0;
end;
end;
为什么这段代码只可以止赢平仓不能止损平仓?? 而且用debugfile来显示 c<=(tenterprice-zsd) 它的值是为0 的(在有符合的情况下)?如果是止盈平仓的话,那么相应的c>=(TENTERPRICE+zyd)值会是为1?这是什么情况呀?抓狂了。。
[此贴子已经被作者于2013-1-22 13:43:29编辑过]
输出c,输出tenterprice,输出zsd,再看看是否满足条件
2013-01-22 13:49:12.635 dk:= 0
2013-01-22 13:49:12.636 kk:= 0
2013-01-22 13:49:12.636 DZY:= 0
2013-01-22 13:49:12.636 DZS:= 0
2013-01-22 13:49:12.636 KZY:= 0
2013-01-22 13:49:12.637 KZS:= 0
2013-01-22 13:49:12.637 成交历时:= 0
2013-01-22 13:49:12.637 openprice:= 2607
2013-01-22 13:49:12.637 挂单量:= 0
2013-01-22 13:49:12.638 mark:= 1
2013-01-22 13:49:12.638 tholding:= 2
2013-01-22 13:49:12.638 DZSX:= 2604
2013-01-22 13:49:12.638 KZSX:= 2610 带上一小段当时输出 的值 。当时的帐户现价有小于2604
记录输出3个部分,
c,(tenterprice-zsd),tenterprice
然后再做比较