Rss & SiteMap

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

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

标题:请版主帮忙

1楼
zhouyun3400 发表于:2010/7/29 15:54:05

//准备中间变量
h30:ref(hhv(h,30),1);
l30:ref(llv(l,30),1);
中线:(h30+l30)/2;
NUM:=TBUYHOLDINGEX('84115','',1)+(0-TSELLHOLDINGEX('84115','',1));
DEBUGOUT('84115THOLDING=%.0f',NUM);
DEBUGFILE('D:\My Documents\我的文件\ControlCenter3\海通期货金字塔交易终端\84115.TXT','84115THOLDING=%.0f',NUM);

//建立多头建仓条件
long:=h>h30 and time>091000 and time<145200;
if long then
   begin
   sellshort(holding<0,0,limitr,h30);
   buy(holding=0,1,limitr,h30);
   end
  
pk:=c>h30-(1*MINDIFF) and time>091000 and time<145200; 
Tsellshort(pk and NUM<0,0,mkt,0,0,'84115');
dt:=c>h30 and time>091000 and time<145200;
Tbuy(dt and NUM=0,1,mkt,0,0,'84115');
  
//画出多头止损线
PARTLINE(holding>0,l30,colorred);

//建立空头建仓条件
short:=l<l30 and time>091000 and time<145200;
if short then
   begin
   sell(holding>0,0,limitr,l30);
   buyshort(holding=0,1,limitr,l30);
   end
  
pd:=c<l30+(1*MINDIFF) and time>091000 and time<145200;  
Tsell(pd and NUM>0,0,mkt,0,0,'84115');
kt:=l30>c and time>091000 and time<145200;
Tbuyshort(kt and NUM=0,1,mkt,0,0,'84115');
  
//画出空头止损线
PARTLINE(holding<0,h30,colorgreen);

//收盘前平仓
sell(time>145500 and holding>0,0,limitr,OPEN);
sellshort(time>145500 and holding<0,0,limitr,OPEN);
Tsell(time>145500,0,mkt,0,0,'84115');
Tsellshort(time>145500,0,mkt,0,0,'84115');

 

上面的公式我采用5分钟K线实盘后台交易,中段的平空开多、平多开空都没有问题,就是尾盘的收盘前平仓指令不执行,加上指定卖持(指定买持)都没有效果。请版主帮我看一下公式,指出问题之所在,不胜感谢!

2楼
fly 发表于:2010/7/29 17:06:04
 时间函数用的不对,应用currenttime
tSELL(currenttime>145500 and tHOLDING>0,0,lmt,DYNAINFO(20)-3*MINDIFF);
tSELLSHORT(currenttime>145500 and tHOLDING<0,0,lmt,DYNAINFO(21)+3*MINDIFF);

 

3楼
zhouyun3400 发表于:2010/7/29 18:23:34
图片点击可在新窗口打开查看
4楼
admin 发表于:2010/7/29 23:45:58

试试去掉最后的指定帐号 '84115'

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


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