请看图啊,这个又让我纠结了,程序上是没有问题的。
观察了一下这个,是不是服务器和账户返回有问题呢?
请仔细看图!!
[此贴子已经被作者于2015/6/9 22:58:52编辑过]
再贴个图,是下单指令和当时的K线图。我程序设定的就是3个大点的止损,图上也看到了,根本就没到我止损的位置。
下面是我止损的代码:
A:=mindiff;//取模组交易合约的最小变动价位
kdzsjg:=tENTERPRICe-4*a,COLORRED;//多单止损价格
kkzsjg:=tENTERPRICe+4*a,COLORBLACK;//空单止损价格
kdzs1:=C<kdzsjg and tholding>0 ;//and abb;//多单止损条件1
kkzs1:=c>kkzsjg and tholding<0 ;//and abb;//空单止损条件1
kdzs4:=cross(qsx,c) and tholding>0;//多单止损条件2
kkzs4:=cross(c,qsx) and tholding<0;//空单止损条件2
kdzs3:=(tenterprice-kcwzl)>=6*a and c<=tenterprice-6*a and tholding>0 and abb;//多单止损条件3
kkzs3:=(kcwzh-tenterprice)>=6*a and c>=tenterprice+6*a and tholding<0 and abb;//空单止损条件3
kdzs2:=c<ref(o,1) and tholding>0;
kkzs2:=c>ref(o,1) and tholding<0;
{DEBUGFILE('D:\金子塔调试文件保存\TEST.TXT','多单22止损条件为 %.0f',c<ref(o,1));
DEBUGFILE('D:\金子塔调试文件保存\TEST.TXT','空单止损条件为 %.0f',c>ref(o,1));
DEBUGFILE('D:\金子塔调试文件保存\TEST.TXT','现价为 %.0f',c);
}
if kdzs1 or kdzs2 or kdzs3 then
begin
tsell(tholding>0 and TISPRVREMAIN(2)=0,0,mkt) ;//平多止损
ENd
if kkzs1 or kkzs2 or kkzs3 then
begin
tsellshort(tholding<0 and TISPRVREMAIN(4)=0,0,mkt) ;//平空止损
end
此主题相关图片如下:qq截图20150609230448.png

你自己就不会去用debugfile函数调试跟踪一下止损条件?你这样发过来代码,叫我们去猜问题?
tsellshort里用的市价指令,委托记录里是委托的价格,成交明细里是成交的价格。有什么不对吗?