以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://weistock.com/bbs/index.asp)
--  金字塔软件问题提交  (http://weistock.com/bbs/list.asp?boardid=2)
----  [注意]todaybar的问题,请再次确认!  (http://weistock.com/bbs/dispbbs.asp?boardid=2&id=67092)

--  作者:qwer123
--  发布时间:2014/7/7 21:49:47
--  [注意]todaybar的问题,请再次确认!
前面我说了todaybar使用起来好像有问题,客服确认了没有出现我说的问题,后来王锋也加以了说明。刚才用白银夜盘实测了一下,确实存在问题
在在第一根k线,todaybar不是1,而是昨天开盘到现在的k线数,当地一根k线结束时第一个k线的todaybar才变成1。

测试环境:白银30分钟k线,金字塔时间,金字塔3.21标准版
同时输出:
R1:barslast(date<>ref(date,1)),linethick0;
R2:ref(o,r1),linethick0;
R3:todaybar-1,linethick0;
R4:ref(o,r3),linethick0;

结果:R1:=0;R2:=4296;-------------------------这个结果是对的;
        R3:=???(忘了);R4:=4347;------------这个是错的


请你们再次确认!!






--  作者:RogarZ
--  发布时间:2014/7/8 0:25:04
--  

你用在哪个时区上?

北京时区的话,就不会是1  因为它是算作今天的时间 并不是算第二天

 

这个函数依赖时区的。


--  作者:qwer123
--  发布时间:2014/7/8 5:54:50
--  
使用的是“交易所/金字塔时区”;程序中交易时间限制语句:p1:=time>=010000 and time<063000;
1.不管是什么时区,todaybar-1和barslast(date<>ref(date,1))应该是一致的;
2.前面我交易股指期货,程序中使用的交易时间限制语句:p1:=time>091500 and time<151500,使用了todaybar,if toadybar>1 and .......then;按理说第一根k线不应该出现信号,可是在实盘时,第一根k线一开始就出现信号,k线结束时信号消失(如果不加第1根不交易限制,是有信号的),后来我改用了barslast(date<>ref(date,1))就没有问题了。


--  作者:FexTel
--  发布时间:2014/7/8 9:17:46
--  

1,上次您提出问题后我们本地也测试了下,发现值的刷新没有问题

2,今日测试后依旧没有问题,附件为测试日志。分别为白银和股指

 

 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:todaybar.rar


--  作者:qwer123
--  发布时间:2014/7/8 9:29:09
--  
这个我不知道为什么,昨天晚上我是没事一直盯着看的,没有输出文件,todaybar就是不对,一开盘就给下单了。我就把程序停了手动平仓了,由于是30分钟周期,信号一直在,改用barslast(date<>ref(date,1))信号就消失了,由于周期很大,我有时间同时输出,todaybar等值,todaybar显然是不对的。后来我就一直盯着看,到1:30(21:30)时信号消失,todaybar变成1。


--  作者:FexTel
--  发布时间:2014/7/8 9:39:43
--  

1,北京时区TODAYBRS取值是不能跨天的

2,DEBUGFILE输出看下,我明天也测试信号情况,就是todaybar>1对吧?


--  作者:qwer123
--  发布时间:2014/7/8 9:40:29
--  
这个todaybar在1:30分之前是上个交易日开盘到现在的k线数。所以ref(o,todaybar-1)=上个交易日的开盘价
[此贴子已经被作者于2014/7/8 9:41:27编辑过]

--  作者:FexTel
--  发布时间:2014/7/8 9:51:42
--  

1,明天您个电脑盯盘看下,另外也DEBUGFILE输出下记录文件

2,我本地会继续跟踪测试


--  作者:qwer123
--  发布时间:2014/7/8 9:52:36
--  
好!
--  作者:qwer123
--  发布时间:2014/7/8 21:31:25
--  
这个是我在程序后面加的

rt:todaybar,linethick0;
rd:barslast(date<>ref(date,1))+1,linethick0;
debugfile(\'d:\\test1.txt\',\'value for todaybar=%.0f\',rt);
debugfile(\'d:\\test1.txt\',\'value for barslast+1=%.0f\',rd);

输出结果:
2014-07-08 20:54:44.484    value for todaybar=19
2014-07-08 20:54:44.484    value for barslast+1=19
2014-07-08 20:54:51.675    value for todaybar=19
2014-07-08 20:54:51.675    value for barslast+1=19
2014-07-08 20:54:59.567    value for todaybar=19
2014-07-08 20:54:59.567    value for barslast+1=19
2014-07-08 20:55:27.174    value for todaybar=19
2014-07-08 20:55:27.174    value for barslast+1=19
2014-07-08 20:55:59.186    value for todaybar=19
2014-07-08 20:55:59.201    value for barslast+1=19
2014-07-08 20:55:59.295    value for todaybar=19
2014-07-08 20:55:59.295    value for barslast+1=19
2014-07-08 20:55:59.389    value for todaybar=19
2014-07-08 20:55:59.389    value for barslast+1=19
2014-07-08 20:58:03.161    value for todaybar=19
2014-07-08 20:58:03.161    value for barslast+1=19
2014-07-08 20:58:59.430    value for todaybar=20
2014-07-08 20:58:59.430    value for barslast+1=1
2014-07-08 20:58:59.836    value for todaybar=20
2014-07-08 20:58:59.836    value for barslast+1=1
2014-07-08 20:59:59.256    value for todaybar=20
2014-07-08 20:59:59.256    value for barslast+1=1
2014-07-08 20:59:59.662    value for todaybar=20
2014-07-08 20:59:59.662    value for barslast+1=1
2014-07-08 20:59:59.865    value for todaybar=20
2014-07-08 20:59:59.865    value for barslast+1=1
2014-07-08 21:00:00.067    value for todaybar=20
2014-07-08 21:00:00.067    value for barslast+1=1
2014-07-08 21:00:00.270    value for todaybar=20
2014-07-08 21:00:00.270    value for barslast+1=1
2014-07-08 21:00:00.676    value for todaybar=20
2014-07-08 21:00:00.676    value for barslast+1=1
2014-07-08 21:00:00.879    value for todaybar=20
2014-07-08 21:00:00.879    value for barslast+1=1
2014-07-08 21:00:01.300    value for todaybar=20
2014-07-08 21:00:01.300    value for barslast+1=1
2014-07-08 21:00:01.690    value for todaybar=20
2014-07-08 21:00:01.690    value for barslast+1=1
2014-07-08 21:00:01.893    value for todaybar=20
2014-07-08 21:00:01.893    value for barslast+1=1
2014-07-08 21:00:02.298    value for todaybar=20
2014-07-08 21:00:02.298    value for barslast+1=1
2014-07-08 21:00:02.907    value for todaybar=20
2014-07-08 21:00:02.907    value for barslast+1=1
2014-07-08 21:00:03.312    value for todaybar=20
2014-07-08 21:00:03.312    value for barslast+1=1
2014-07-08 21:00:03.921    value for todaybar=20
2014-07-08 21:00:03.921    value for barslast+1=1
2014-07-08 21:00:04.326    value for todaybar=20
2014-07-08 21:00:04.326    value for barslast+1=1
2014-07-08 21:00:04.935    value for todaybar=20
2014-07-08 21:00:04.935    value for barslast+1=1
2014-07-08 21:00:05.340    value for todaybar=20
2014-07-08 21:00:05.340    value for barslast+1=1
2014-07-08 21:00:05.746    value for todaybar=20
2014-07-08 21:00:05.746    value for barslast+1=1
2014-07-08 21:00:06.354    value for todaybar=20
2014-07-08 21:00:06.354    value for barslast+1=1
2014-07-08 21:00:06.760    value for todaybar=20
2014-07-08 21:00:06.760    value for barslast+1=1
2014-07-08 21:00:07.368    value for todaybar=20
2014-07-08 21:00:07.368    value for barslast+1=1
2014-07-08 21:00:07.774    value for todaybar=20
2014-07-08 21:00:07.774    value for barslast+1=1
2014-07-08 21:00:08.257    value for todaybar=20
2014-07-08 21:00:08.257    value for barslast+1=1
2014-07-08 21:00:08.788    value for todaybar=20
2014-07-08 21:00:08.788    value for barslast+1=1
2014-07-08 21:00:09.193    value for todaybar=20
2014-07-08 21:00:09.193    value for barslast+1=1
2014-07-08 21:00:09.396    value for todaybar=20
2014-07-08 21:00:09.396    value for barslast+1=1
2014-07-08 21:00:09.802    value for todaybar=20
2014-07-08 21:00:09.802    value for barslast+1=1
2014-07-08 21:00:10.005    value for todaybar=20
2014-07-08 21:00:10.005    value for barslast+1=1
2014-07-08 21:00:10.410    value for todaybar=20
2014-07-08 21:00:10.410    value for barslast+1=1
2014-07-08 21:00:10.613    value for todaybar=20
2014-07-08 21:00:10.613    value for barslast+1=1
2014-07-08 21:00:10.816    value for todaybar=20
2014-07-08 21:00:10.816    value for barslast+1=1
2014-07-08 21:00:11.019    value for todaybar=20
2014-07-08 21:00:11.019    value for barslast+1=1
2014-07-08 21:00:11.237    value for todaybar=20
2014-07-08 21:00:11.237    value for barslast+1=1
2014-07-08 21:00:11.627    value for todaybar=20
2014-07-08 21:00:11.627    value for barslast+1=1
2014-07-08 21:00:11.830    value for todaybar=20
2014-07-08 21:00:11.830    value for barslast+1=1
2014-07-08 21:00:12.235    value for todaybar=20
2014-07-08 21:00:12.235    value for barslast+1=1
2014-07-08 21:00:12.438    value for todaybar=20
2014-07-08 21:00:12.438    value for barslast+1=1
2014-07-08 21:00:12.641    value for todaybar=20
2014-07-08 21:00:12.641    value for barslast+1=1
2014-07-08 21:00:12.844    value for todaybar=20
2014-07-08 21:00:12.844    value for barslast+1=1
2014-07-08 21:00:13.249    value for todaybar=20
2014-07-08 21:00:13.249    value for barslast+1=1
2014-07-08 21:00:13.452    value for todaybar=20
2014-07-08 21:00:13.452    value for barslast+1=1
2014-07-08 21:00:13.858    value for todaybar=20
2014-07-08 21:00:13.858    value for barslast+1=1
2014-07-08 21:00:14.263    value for todaybar=20
2014-07-08 21:00:14.263    value for barslast+1=1
2014-07-08 21:00:14.466    value for todaybar=20
2014-07-08 21:00:14.466    value for barslast+1=1
2014-07-08 21:00:14.669    value for todaybar=20
2014-07-08 21:00:14.669    value for barslast+1=1
2014-07-08 21:00:14.872    value for todaybar=20
2014-07-08 21:00:14.872    value for barslast+1=1
2014-07-08 21:00:15.277    value for todaybar=20
2014-07-08 21:00:15.277    value for barslast+1=1
2014-07-08 21:00:15.480    value for todaybar=20
2014-07-08 21:00:15.480    value for barslast+1=1
2014-07-08 21:00:16.291    value for todaybar=20
2014-07-08 21:00:16.291    value for barslast+1=1
2014-07-08 21:00:17.103    value for todaybar=20
2014-07-08 21:00:17.103    value for barslast+1=1
。。。。。。
2014-07-08 21:29:57.696    value for todaybar=20
2014-07-08 21:29:57.698    value for barslast+1=1
2014-07-08 21:29:57.902    value for todaybar=20
2014-07-08 21:29:57.904    value for barslast+1=1
2014-07-08 21:29:58.505    value for todaybar=20
2014-07-08 21:29:58.506    value for barslast+1=1
2014-07-08 21:29:58.916    value for todaybar=2
2014-07-08 21:29:58.917    value for barslast+1=2
2014-07-08 21:29:59.113    value for todaybar=2
2014-07-08 21:29:59.114    value for barslast+1=2
2014-07-08 21:29:59.314    value for todaybar=2
2014-07-08 21:29:59.314    value for barslast+1=2
2014-07-08 21:29:59.517    value for todaybar=2
2014-07-08 21:29:59.517    value for barslast+1=2
2014-07-08 21:29:59.931    value for todaybar=2
2014-07-08 21:29:59.933    value for barslast+1=2
2014-07-08 21:30:00.128    value for todaybar=2
2014-07-08 21:30:00.128    value for barslast+1=2
2014-07-08 21:30:00.334    value for todaybar=2
2014-07-08 21:30:00.336    value for barslast+1=2
2014-07-08 21:30:00.736    value for todaybar=2
2014-07-08 21:30:00.737    value for barslast+1=2
2014-07-08 21:30:00.941    value for todaybar=2
2014-07-08 21:30:00.943    value for barslast+1=2
2014-07-08 21:30:01.159    value for todaybar=2
2014-07-08 21:30:01.160    value for barslast+1=2
2014-07-08 21:30:01.342    value for todaybar=2
2014-07-08 21:30:01.343    value for barslast+1=2
2014-07-08 21:30:01.751    value for todaybar=2
2014-07-08 21:30:01.753    value for barslast+1=2
2014-07-08 21:30:01.955    value for todaybar=2
2014-07-08 21:30:01.956    value for barslast+1=2
2014-07-08 21:30:02.359    value for todaybar=2
2014-07-08 21:30:02.359    value for barslast+1=2
2014-07-08 21:30:02.559    value for todaybar=2

这应该是有问题的,请好好检查!