以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  公式模型编写问题提交  (http://weistock.com/bbs/list.asp?boardid=4)
----  [求助]后台数据重叠  (http://weistock.com/bbs/dispbbs.asp?boardid=4&id=29960)

--  作者:jhoncongchen
--  发布时间:2012/10/19 13:17:44
--  [求助]后台数据重叠

这是我的bugfile2中的记录,

2012-10-19 13:06:23.625    open_close_min2320.20
2012-10-19 13:06:23.640    open_close_max2323.00


2012-10-19 13:06:23.625    open_close_min2318.60
2012-10-19 13:06:23.625    open_close_max2320.20

这是怎么回事

 

两个绿色 时间点相同,但是同一个变量却相差很大,达2320.20-2318.60=1.6


--  作者:jinzhe
--  发布时间:2012/10/19 13:33:10
--  

能发一下公式吗?


--  作者:jhoncongchen
--  发布时间:2012/10/19 16:14:40
--  

ref_close := close[barpos-1];

ref_open := open[barpos-1];

open_close_min := min(ref_close,ref_open);

open_close_max := max(ref_close,ref_open);

 

k线模式下运行代码

 

另外,模拟环境下,后台运行,tholding读不到仓位?


--  作者:jhoncongchen
--  发布时间:2012/10/19 16:20:06
--  

后台运行,采用5min钟周期,固定轮询,

2012-10-19 14:52:43.453 2012-10-19 14:52:43.468 , 时间间隔为15毫秒

同时为了测试open能否在后台中运行,

2012-10-19 14:52:43.468    kaipanjia2351.80

2012-10-19 14:52:43.468    kaipanjia2349.20

2012-10-19 14:52:43.484    kaipanjia2351.40

kaipanjia := open;

 

为什么在5min中周期下,open不是固定的价格,而是不断变化的?

给我程序造成啦很大困难,希望解决。


--  作者:jinzhe
--  发布时间:2012/10/19 16:22:09
--  

怎么输出的,输出变量的代码是什么


--  作者:jhoncongchen
--  发布时间:2012/10/19 16:58:36
--  
debugfile2(path, \'open_close_min%.02f\', open_close_min);
--  作者:jhoncongchen
--  发布时间:2012/10/19 16:59:15
--  
debugfile2(path, \'open_close_min%.02f\', open_close_min,0);
--  作者:王锋
--  发布时间:2012/10/19 17:07:09
--  

可否给出一个能复现该问题的公式代码,便于我们进行问题的排查


--  作者:jhoncongchen
--  发布时间:2012/10/22 11:20:38
--  

2012-10-22 11:11:05.283    zuigaozhi2316.40
2012-10-22 11:11:05.283    zuigaozhi2316.40
2012-10-22 11:11:05.283    kaipanjia2315.40
2012-10-22 11:11:05.283    shoupanjia2313.60
2012-10-22 11:11:05.283    开仓以来根数0
2012-10-22 11:11:05.283    zuixiaozhi2311.20
 

红色显示, 同一时刻,zuixiaozhi有不同的值

你们用这个简单的后台代码测试下吧

 

以下内容为程序代码:

1 support := ma(high, 40);
2 resistance := ma(low, 40);
3 bccond := high > ref(support , 1);
4 spcond := low < ref(resistance, 1);
5 if tholding = 0 then begin
6     if bccond then     tbuy(1,1,lmt,high+mindiff,0);
7     if spcond then tbuyshort(1,1, lmt, low-mindiff, 0);
8 end
9
10 if tholding > 0 then begin
11     if spcond then begin
12         tsell(1,1, lmt, low-mindiff, 0);
13         tbuyshort(1,1, lmt, low-mindiff, 0);
14     end
15 end
16
17 if tholding < 0 then begin
18     if bccond then begin
19         tsellshort(1,1,lmt,high+mindiff,0);
20         tbuy(1,1,lmt,high+mindiff,0);
21     end
22 end
23
24 debugfile2(\'f:\\file\\strategy\\interval\\houtai\\debugfile.txt\',\'开仓以来根数%.0f\',tenterbars,1);
25 debugfile2(\'f:\\file\\strategy\\interval\\houtai\\debugfile.txt\',\'zuixiaozhi%.2f\',low,1);
26 debugfile2(\'f:\\file\\strategy\\interval\\houtai\\debugfile.txt\',\'zuigaozhi%.2f\',high,1);
27 debugfile2(\'f:\\file\\strategy\\interval\\houtai\\debugfile.txt\',\'kaipanjia%.2f\',open,1);
28 debugfile2(\'f:\\file\\strategy\\interval\\houtai\\debugfile.txt\',\'shoupanjia%.2f\',close,1);
2012-10-22 11:11:05.283    zuixiaozhi2311.40