Rss & SiteMap

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

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

标题:关于后台网格交易模型

1楼
安天步 发表于:2016/8/18 14:14:36
input:grid(20,1,60,10);
variable:level=0;
oo:CALLSTOCK('ic08',VTopen,6,0);
cc:=callstock('ic08',vtclose,1,0);


if time=093100 and cc>oo then 
begin 
 tbuy(1,1,mkt); 
 level:=level+1;
 upprice:=oo+level*grid;
 DNPRICE:=oo+(level-1)*grid;
end
if time=093100 and cc<=oo then 
begin
 tbuyshort(1,1,mkt);
 level:=0;
 upprice:=oo+level*grid;
 DNPRICE:=oo+(level-1)*grid;
end 

上多:=tbuyholding(1)>0 and cc>=upprice;
下多:=tbuyholding(1)>0 and dnprice>cc;
t1:=cc>=upprice;

 if 上多 then
  begin
  level:=level+1;
  upprice:=oo+level*grid;
  DNPRICE:=oo+(level-1)*grid; 
  end
 
 if 下多 then
  begin
  PD:tsell(1,tholding,mkt);
  KK:tbuyshort(1,1,mkt);
  level:=level-1;
  upprice:=oo+level*grid;
  DNPRICE:=oo+(level-1)*grid; 
  end
  
if time=closetime(0) and tbuyholding(1)>0 then
tsell(1,tholding,mkt);

上空:=tsellholding(1)>0 and cc>=upprice;
下空:=tsellholding(1)>0 and cc<DNPRICE;

 if 上空 then
  begin
  PK:tsellshort(1,tholding,mkt);
  KD:tbuy(1,1,mkt);
  level:=level+1;
  upprice:=oo+level*grid;
  DNPRICE:=oo+(level-1)*grid; 
  end
 
 if 下空 then
  begin
  level:=level-1;
  upprice:=oo+level*grid;
  DNPRICE:=oo+(level-1)*grid; 
  end

if time=closetime(0) and tsellholding(1)>0 then
tsellshort(1,tholding,mkt);


debugfile('d:\test后台.txt','tbuyholding(1) = %.2f',tbuyholding(1));
debugfile('d:\test后台.txt','tsellholding(1) = %.2f',tsellholding(1));
debugfile('d:\test后台.txt','cc = %.2f',cc);
debugfile('d:\test后台.txt','upprice = %.2f',upprice);
debugfile('d:\test后台.txt','DNPRICE = %.2f',DNPRICE);
debugfile('d:\test后台.txt','上多 = %.2f',上多);
debugfile('d:\test后台.txt','下多 = %.2f',下多);
debugfile('d:\test后台.txt','上空 = %.2f',上空);
debugfile('d:\test后台.txt','下空 = %.2f',下空);
debugfile('d:\test后台.txt','level = %.2f',level);

金哲老师,请您帮忙看看这个公式哪里有问题?我个人看到是LEVEL一直没变过,是不是全局变量设置有问题?
 下载信息  [文件大小:   下载次数: ]
点击浏览该文件:test后台.txt

2楼
jinzhe 发表于:2016/8/18 14:17:29

variable这个是图表全局变量

后台全局变量用globalvariable,每次关闭交易后再启动时重置为初值

3楼
安天步 发表于:2016/8/18 14:28:07
原来是这样啊,这2个函数没解释清楚。
共3 条记录, 每页显示 10 条, 页签: [1]


Powered By Dvbbs Version 8.3.0
Processed in 0.03076 s, 4 queries.