{"action":"created","issue":{"url":"https://api.github.com/repos/vnpy/vnpy/issues/146","repository_url":"https://api.github.com/repos/vnpy/vnpy","labels_url":"https://api.github.com/repos/vnpy/vnpy/issues/146/labels{/name}","comments_url":"https://api.github.com/repos/vnpy/vnpy/issues/146/comments","events_url":"https://api.github.com/repos/vnpy/vnpy/issues/146/events","html_url":"https://github.com/vnpy/vnpy/issues/146","id":173967734,"number":146,"title":"用tick数据回测报错","user":{"login":"bailzx5522","id":2831628,"avatar_url":"https://avatars.githubusercontent.com/u/2831628?v=3","gravatar_id":"","url":"https://api.github.com/users/bailzx5522","html_url":"https://github.com/bailzx5522","followers_url":"https://api.github.com/users/bailzx5522/followers","following_url":"https://api.github.com/users/bailzx5522/following{/other_user}","gists_url":"https://api.github.com/users/bailzx5522/gists{/gist_id}","starred_url":"https://api.github.com/users/bailzx5522/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bailzx5522/subscriptions","organizations_url":"https://api.github.com/users/bailzx5522/orgs","repos_url":"https://api.github.com/users/bailzx5522/repos","events_url":"https://api.github.com/users/bailzx5522/events{/privacy}","received_events_url":"https://api.github.com/users/bailzx5522/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/vnpy/vnpy/labels/help%20wanted","name":"help wanted","color":"159818"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-30T09:11:17Z","updated_at":"2016-08-31T01:34:22Z","closed_at":null,"body":"\r\n2016-08-30 16:37:39.495689      开始载入数据\r\n2016-08-30 16:37:40.252924      载入完成，数据量：32114\r\n2016-08-30 16:37:40.253018      开始回测\r\nTraceback (most recent call last):\r\n  File \"strategyAtrRsi.py\", line 283, in <module>\r\n    engine.runBacktesting()\r\n  File \"/opt/vnpy/vn.trader/ctaAlgo/ctaBacktesting.py\", line 165, in runBacktesting\r\n    self.strategy.onInit()\r\n  File \"/opt/vnpy/vn.trader/ctaAlgo/strategyAtrRsi.py\", line 101, in onInit\r\n    self.onBar(bar)\r\n  File \"/opt/vnpy/vn.trader/ctaAlgo/strategyAtrRsi.py\", line 163, in onBar\r\n    self.closeArray[-1] = bar.close\r\nAttributeError: 'CtaBarData' object has no attribute 'close'\r\n\r\n使用tick数据的时候ctaEngine的loadBar方法初始化的是CtaBarData\r\n没有将tick源数据转换成bar类型。所以取bar.close的时候报错"},"comment":{"url":"https://api.github.com/repos/vnpy/vnpy/issues/comments/243633192","html_url":"https://github.com/vnpy/vnpy/issues/146#issuecomment-243633192","issue_url":"https://api.github.com/repos/vnpy/vnpy/issues/146","id":243633192,"user":{"login":"vnpy","id":11263900,"avatar_url":"https://avatars.githubusercontent.com/u/11263900?v=3","gravatar_id":"","url":"https://api.github.com/users/vnpy","html_url":"https://github.com/vnpy","followers_url":"https://api.github.com/users/vnpy/followers","following_url":"https://api.github.com/users/vnpy/following{/other_user}","gists_url":"https://api.github.com/users/vnpy/gists{/gist_id}","starred_url":"https://api.github.com/users/vnpy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vnpy/subscriptions","organizations_url":"https://api.github.com/users/vnpy/orgs","repos_url":"https://api.github.com/users/vnpy/repos","events_url":"https://api.github.com/users/vnpy/events{/privacy}","received_events_url":"https://api.github.com/users/vnpy/received_events","type":"User","site_admin":false},"created_at":"2016-08-31T01:34:22Z","updated_at":"2016-08-31T01:34:22Z","body":"这个策略的代码写的时候使用的是bar回测的模式，享用tick回测的话需要自己做一些修改。"}}
{"actor":{"display_login":"vnpy"}}