Rss & SiteMap

金字塔客服中心 - 专业程序化交易软件提供商 http://www.weistock.com/bbs/

专业程序化软件提供商
共4 条记录, 每页显示 10 条, 页签: [1]
[浏览完整版]

标题:这样的代码为啥,有时会只平不开仓呢?

1楼
qq代人发帖 发表于:2014/7/4 16:02:41
请教: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 
2楼
jinzhe 发表于:2014/7/4 16:26:34

有3个条件

kk,  hold=0, -tholding<ss

其中有一个不成立

3楼
Ivan 发表于:2014/7/4 23:11:55
以下是引用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以下呢!

4楼
jinzhe 发表于:2014/7/7 9:32:19

不要那么肯定,有一个不成立,不要怀疑计算机的计算能力

你用debugfile调试输出一下各个条件

共4 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.02246 s, 3 queries.