以文本方式查看主题

-  金字塔客服中心 - 专业程序化交易软件提供商  (http://222.73.7.161/bbs/index.asp)
--  公式模型编写问题提交  (http://222.73.7.161/bbs/list.asp?boardid=4)
----  BUG:count函数计算错误  (http://222.73.7.161/bbs/dispbbs.asp?boardid=4&id=5278)

--  作者:paulshen
--  发布时间:2011/2/24 12:25:27
--  BUG:count函数计算错误

最近一次升级后,count函数计算出现错误,以前一直没错过。简化公式如下:

 

nSE1:=6;

nBE1:=6;

 

THV2:=HHV(High,5);

TLV2:=LLV(Low,5);

 

DHigh:=max(dynainfo(34),HIGH);
DLow:=min(dynainfo(28),LOW);
hTHV21:=DHigh>THV2;
lTLV21:=TLV2>DLow;

ChTHV21:=count(hTHV21,nSE1);
ClTLV21:=count(lTLV21,nBE1);

 

DEBUGFILE(FILEPATH,\'lTLV21:\'&numtostr(lTLV21,0)&\' hTHV21:\'&numtostr(hTHV21,0)&\' ClTLV21:\'&numtostr(ClTLV21,0)&\' ChTHV21:\'&numtostr(ChTHV21,0),0);
DEBUGFILE(FILEPATH,\'DHigh:\'&numtostr(DHigh,1)&\' DLow:\'&numtostr(DLow,1)&\' nSE1:\'&numtostr(nSE1,0)&\' nBE1:\'&numtostr(nBE1,0),0);

 

输出数据出现这样的情况(红色字体):同一周期内,ITLV21一直为0的情况下,count输出变成了1,当lTLV21变成1时,count输出了3。请帮忙查一下是什么问题,是否最近的升级对count有改动。我用的是后台序列模式。谢谢。

 

2011-02-24 10:35:58.286    =======
2011-02-24 10:35:58.286    Time:103600.000 cTime:103558.000
2011-02-24 10:35:58.302    O:3197.0 H:3198.2 L:3191.6 C:3192.2
2011-02-24 10:35:58.318    DY28:3191.8 DY34:3192.0 minL28:3191.6 maxH34:3198.2
2011-02-24 10:35:58.349    HV12:3209.00 LV12:3165.40 THV2:3183.17 TLV2:3191.23
2011-02-24 10:35:58.364    lTLV21:0 hTHV21:1 ClTLV21:0 ChTHV21:44
2011-02-24 10:35:58.396    DHigh:3198.2 DLow:3191.6 nSE1:44 nBE1:6
2011-02-24 10:35:58.411    SO:0 BO:0 TSubmit(0):0.00
2011-02-24 10:35:58.458    SLH:3206.4 SLL:3188.4 HR:11.6 LR:32.0 B_SL:0 S_SL:0
2011-02-24 10:35:58.458    TBHEX:5 TSHEX:0 TV4B:5
2011-02-24 10:35:58.458    TAP:3197.4 TEP:3197.4
2011-02-24 10:35:58.474    MATR:6.7
2011-02-24 10:35:58.474    N1:62 N2:5 SL:9 OA:5 AP:3 HT:81
2011-02-24 10:35:58.474    X:2.66
2011-02-24 10:35:58.489    GSL:0 GBP:0 BP:117
2011-02-24 10:35:59.427    =======
2011-02-24 10:35:59.427    Time:103600.000 cTime:103559.000
2011-02-24 10:35:59.443    O:3197.0 H:3198.2 L:3191.6 C:3191.8
2011-02-24 10:35:59.458    DY28:3191.6 DY34:3191.8 minL28:3191.6 maxH34:3198.2
2011-02-24 10:35:59.474    HV12:3209.00 LV12:3165.40 THV2:3183.17 TLV2:3191.23
2011-02-24 10:35:59.505    lTLV21:0 hTHV21:1 ClTLV21:1 ChTHV21:44
2011-02-24 10:35:59.536    DHigh:3198.2 DLow:3191.6 nSE1:44 nBE1:6
2011-02-24 10:35:59.552    SO:0 BO:0 TSubmit(0):0.00
2011-02-24 10:35:59.599    SLH:3206.4 SLL:3188.4 HR:11.6 LR:1.2 B_SL:0 S_SL:0
2011-02-24 10:35:59.599    TBHEX:5 TSHEX:0 TV4B:5
2011-02-24 10:35:59.599    TAP:3197.4 TEP:3197.4
2011-02-24 10:35:59.614    MATR:6.7
2011-02-24 10:35:59.614    N1:62 N2:5 SL:9 OA:5 AP:3 HT:81
2011-02-24 10:35:59.614    X:2.66
2011-02-24 10:35:59.614    GSL:0 GBP:0 BP:117
2011-02-24 10:36:00.130    =======
2011-02-24 10:36:00.130    Time:103600.000 cTime:103600.000
2011-02-24 10:36:00.146    O:3197.0 H:3198.2 L:3191.6 C:3191.6
2011-02-24 10:36:00.161    DY28:3191.6 DY34:3191.8 minL28:3191.6 maxH34:3198.2
2011-02-24 10:36:00.177    HV12:3209.00 LV12:3165.40 THV2:3183.17 TLV2:3191.23
2011-02-24 10:36:00.208    lTLV21:0 hTHV21:1 ClTLV21:1 ChTHV21:44
2011-02-24 10:36:00.239    DHigh:3198.2 DLow:3191.6 nSE1:44 nBE1:6
2011-02-24 10:36:00.255    SO:0 BO:0 TSubmit(0):0.00
2011-02-24 10:36:00.302    SLH:3206.4 SLL:3188.4 HR:11.6 LR:1.2 B_SL:0 S_SL:0
2011-02-24 10:36:00.302    TBHEX:5 TSHEX:0 TV4B:5
2011-02-24 10:36:00.318    TAP:3197.4 TEP:3197.4
2011-02-24 10:36:00.318    MATR:6.7
2011-02-24 10:36:00.318    N1:62 N2:5 SL:9 OA:5 AP:3 HT:81
2011-02-24 10:36:00.318    X:2.66
2011-02-24 10:36:00.333    GSL:0 GBP:0 BP:117
2011-02-24 10:36:00.536    =======
2011-02-24 10:36:00.536    Time:103600.000 cTime:103600.000
2011-02-24 10:36:00.552    O:3197.0 H:3198.2 L:3191.4 C:3191.4
2011-02-24 10:36:00.568    DY28:3191.4 DY34:3191.8 minL28:3191.4 maxH34:3198.2
2011-02-24 10:36:00.599    HV12:3209.00 LV12:3165.40 THV2:3183.17 TLV2:3191.23
2011-02-24 10:36:00.614    lTLV21:0 hTHV21:1 ClTLV21:1 ChTHV21:44
2011-02-24 10:36:00.646    DHigh:3198.2 DLow:3191.4 nSE1:44 nBE1:6
2011-02-24 10:36:00.661    SO:0 BO:0 TSubmit(0):0.00
2011-02-24 10:36:00.708    SLH:3206.4 SLL:3188.4 HR:11.6 LR:1.2 B_SL:0 S_SL:0
2011-02-24 10:36:00.708    TBHEX:5 TSHEX:0 TV4B:5
2011-02-24 10:36:00.708    TAP:3197.4 TEP:3197.4
2011-02-24 10:36:00.724    MATR:6.7
2011-02-24 10:36:00.724    N1:62 N2:5 SL:9 OA:5 AP:3 HT:81
2011-02-24 10:36:00.724    X:2.66
2011-02-24 10:36:00.724    GSL:0 GBP:0 BP:117
2011-02-24 10:36:00.880    =======
2011-02-24 10:36:00.880    Time:103600.000 cTime:103600.000
2011-02-24 10:36:00.896    O:3197.0 H:3198.2 L:3191.2 C:3191.2
2011-02-24 10:36:00.911    DY28:3191.2 DY34:3191.6 minL28:3191.2 maxH34:3198.2
2011-02-24 10:36:00.943    HV12:3209.00 LV12:3165.40 THV2:3183.17 TLV2:3191.23
2011-02-24 10:36:00.958    lTLV21:1 hTHV21:1 ClTLV21:3 ChTHV21:44
2011-02-24 10:36:00.989    DHigh:3198.2 DLow:3191.2 nSE1:44 nBE1:6
2011-02-24 10:36:01.005    SO:0 BO:0 TSubmit(0):0.00
2011-02-24 10:36:01.052    SLH:3206.4 SLL:3188.4 HR:11.6 LR:1.6 B_SL:0 S_SL:0
2011-02-24 10:36:01.068    TBHEX:5 TSHEX:0 TV4B:5
2011-02-24 10:36:01.068    TAP:3197.4 TEP:3197.4
2011-02-24 10:36:01.068    MATR:6.7
2011-02-24 10:36:01.068    N1:62 N2:5 SL:9 OA:5 AP:3 HT:81
2011-02-24 10:36:01.068    X:2.66
2011-02-24 10:36:01.083    GSL:0 GBP:0 BP:117
2011-02-24 10:36:01.552    =======
2011-02-24 10:36:01.552    Time:103600.000 cTime:103601.000
2011-02-24 10:36:01.568    O:3197.0 H:3198.2 L:3191.2 C:3191.6
2011-02-24 10:36:01.568    DY28:3191.2 DY34:3191.6 minL28:3191.2 maxH34:3198.2
2011-02-24 10:36:01.599    HV12:3209.00 LV12:3165.40 THV2:3183.17 TLV2:3191.23
2011-02-24 10:36:01.614    lTLV21:1 hTHV21:1 ClTLV21:3 ChTHV21:44
2011-02-24 10:36:01.646    DHigh:3198.2 DLow:3191.2 nSE1:44 nBE1:6
2011-02-24 10:36:01.677    SO:0 BO:0 TSubmit(0):0.00
2011-02-24 10:36:01.724    SLH:3206.4 SLL:3188.4 HR:11.6 LR:1.6 B_SL:0 S_SL:0
2011-02-24 10:36:01.724    TBHEX:5 TSHEX:0 TV4B:5
2011-02-24 10:36:01.724    TAP:3197.4 TEP:3197.4
2011-02-24 10:36:01.724    MATR:6.7
2011-02-24 10:36:01.724    N1:62 N2:5 SL:9 OA:5 AP:3 HT:81
2011-02-24 10:36:01.739    X:2.66
2011-02-24 10:36:01.739    GSL:0 GBP:0 BP:117

 


--  作者:fly
--  发布时间:2011/2/24 13:44:25
--  

COUNT函数是没问题的.

问题出在dynainfo的使用上----dynainfo返回常数,而非序列变量.

可参考此帖

http://www.weistock.com/bbs/dispbbs.asp?boardid=4&id=1907&page=1&star=1

 


--  作者:paulshen
--  发布时间:2011/2/24 13:47:08
--  
嗯,我也发现了。谢谢!