{"action":"reopened","issue":{"url":"https://api.github.com/repos/ranaroussi/qtpylib/issues/23","repository_url":"https://api.github.com/repos/ranaroussi/qtpylib","labels_url":"https://api.github.com/repos/ranaroussi/qtpylib/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/ranaroussi/qtpylib/issues/23/comments","events_url":"https://api.github.com/repos/ranaroussi/qtpylib/issues/23/events","html_url":"https://github.com/ranaroussi/qtpylib/issues/23","id":188691485,"number":23,"title":"Algo with 1S resolution does not get a bar every second","user":{"login":"jkleint","id":931505,"avatar_url":"https://avatars.githubusercontent.com/u/931505?v=3","gravatar_id":"","url":"https://api.github.com/users/jkleint","html_url":"https://github.com/jkleint","followers_url":"https://api.github.com/users/jkleint/followers","following_url":"https://api.github.com/users/jkleint/following{/other_user}","gists_url":"https://api.github.com/users/jkleint/gists{/gist_id}","starred_url":"https://api.github.com/users/jkleint/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkleint/subscriptions","organizations_url":"https://api.github.com/users/jkleint/orgs","repos_url":"https://api.github.com/users/jkleint/repos","events_url":"https://api.github.com/users/jkleint/events{/privacy}","received_events_url":"https://api.github.com/users/jkleint/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-11T06:05:50Z","updated_at":"2016-11-12T07:44:09Z","closed_at":null,"body":"If I request a bar every second, I would expect to get, well... a bar every second, even if the quote has not changed.\r\n\r\n```\r\nfrom qtpylib.algo import Algo\r\nfrom time import time\r\n\r\n\r\nclass SecBar(Algo):\r\n    def on_bar(self, instrument):\r\n        print('bar {:.0f} {}'.format(time(), instrument.bar['datetime']))\r\n\r\n\r\nif __name__ == '__main__':\r\n    SecBar([\"AAPL\"], '1S').run()\r\n```\r\n\r\nBut as you can see there are multi-second gaps between bars:\r\n\r\n```\r\n$ python sec_test.py \r\nbar 1478844262 2016-11-11 06:04:21\r\nbar 1478844264 2016-11-11 06:04:23\r\nbar 1478844267 2016-11-11 06:04:26\r\nbar 1478844269 2016-11-11 06:04:28\r\nbar 1478844272 2016-11-11 06:04:32\r\nbar 1478844274 2016-11-11 06:04:34\r\nbar 1478844277 2016-11-11 06:04:37\r\nbar 1478844280 2016-11-11 06:04:40\r\n```\r\n\r\nAm I misunderstanding how bars are supposed to work?"}}
{"actor":{"display_login":"ranaroussi"}}