设为首页收藏本站

 找回密码
 注册
查看: 1707|回复: 1
打印 上一主题 下一主题

求助 跨周期取数据为什么漏取 [复制链接]

Rank: 1

精华
0
UID
239072
积分
5
帖子
3
主题
2
阅读权限
10
注册时间
2016-8-19
最后登录
2017-7-14
跳转到指定楼层
1#
发表于 2016-11-16 11:03:24 |只看该作者 |倒序浏览
代码很简单,在5分钟周期图上取30分钟周期的MACD数据,以下是代码:
        If(Minute() <30)
        {
                HourMinute = 0;
        }Else
        {
                HourMinute = 30;
        }
        If(HourMinute != HourMinute[1])
        {
                strHourKey = Text(Date()) + ":" + Text(Hour()) + ":" + Text(HourMinute);
                strHourValue = GetTBProfileString(Symbol() + "HourMACD", strHourKey);
                HMACDDiff = Value(strHourValue);
                If(IsDebug != 0){
                        FileAppend("C:\\MyMinuteMACD.txt", "strHourKey = " + strHourKey + ", strHourValue = " + strHourValue);
                }
        }
以下是实际取得的数据对照,可以看到9:00的数据没有取到,如何解决?
strHourKey = 20161111:23:0, strHourValue = -29.243892
strHourKey = 20161114:9:30, strHourValue = -29.262216
strHourKey = 20161114:10:0, strHourValue = -26.896408
strHourKey = 20161114:10:30, strHourValue = -23.814253
strHourKey = 20161114:11:0, strHourValue = -21.666752
strHourKey = 20161114:13:30, strHourValue = -21.827527
strHourKey = 20161114:14:0, strHourValue = -19.420212
strHourKey = 20161114:14:30, strHourValue = -18.293177
strHourKey = 20161114:21:0, strHourValue = -14.53983
strHourKey = 20161114:21:30, strHourValue = -10.325063
strHourKey = 20161114:22:0, strHourValue = -7.167216
strHourKey = 20161114:22:30, strHourValue = -3.927583
strHourKey = 20161114:23:0, strHourValue = -1.435739
strHourKey = 20161115:9:30, strHourValue = 5.566584
strHourKey = 20161115:10:0, strHourValue = 7.322522
strHourKey = 20161115:10:30, strHourValue = 8.261985
strHourKey = 20161115:11:0, strHourValue = 8.238711
strHourKey = 20161115:13:30, strHourValue = 5.935197
strHourKey = 20161115:14:0, strHourValue = 4.862404
strHourKey = 20161115:14:30, strHourValue = 4.861431
strHourKey = 20161115:21:0, strHourValue = 6.031764
strHourKey = 20161115:21:30, strHourValue = 6.201893
strHourKey = 20161115:22:0, strHourValue = 6.104964
strHourKey = 20161115:22:30, strHourValue = 6.980534
strHourKey = 20161115:23:0, strHourValue = 7.255121

Rank: 6Rank: 6

精华
0
UID
208212
积分
2006
帖子
103
主题
24
阅读权限
70
注册时间
2015-5-2
最后登录
2019-6-18
2#
发表于 2016-11-16 12:30:05 |只看该作者
30分钟结束的时候才取数吧,所以应该是取到了。9点的时候有啥数据呢?

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

bottom

静态版|手机版|联系我们|交易开拓者 ( 粤ICP备07044698   

GMT+8, 2024-5-17 13:13

Powered by Discuz! X2 LicensedChrome插件扩展

© 2011-2012 交易开拓者 Inc.

回顶部