{"action":"created","comment":{"url":"https://api.github.com/repos/QuantConnect/Lean/pulls/comments/169195798","pull_request_review_id":97683135,"id":169195798,"diff_hunk":"@@ -97,6 +102,86 @@ public void AggregatesNewQuoteBarProperly()\n             Assert.AreEqual(bar3.LastBidSize, quoteBar.LastBidSize);\n             Assert.AreEqual(bar4.LastAskSize, quoteBar.LastAskSize);\n             Assert.AreEqual(bar1.Value, quoteBar.Value);\n+            Assert.AreEqual(bar4.EndTime, quoteBar.EndTime);\n+        }\n+\n+        [Test]\n+        public void AggregatesNewTimeSpanQuoteBarProperly()\n+        {\n+            QuoteBar quoteBar = null;\n+            var creator = new QuoteBarConsolidator(TimeSpan.FromMinutes(2));\n+            creator.DataConsolidated += (sender, args) =>\n+            {\n+                quoteBar = args;\n+            };\n+\n+            var time = DateTime.Today;\n+            var period = TimeSpan.FromMinutes(1);\n+            var bar1 = new QuoteBar\n+            {\n+                Time = time,\n+                Symbol = Symbols.SPY,\n+                Bid = new Bar(1, 2, 0.75m, 1.25m),\n+                LastBidSize = 3,\n+                Ask = null,\n+                LastAskSize = 0,\n+                Value = 1,\n+                Period = period\n+            };\n+            creator.Update(bar1);\n+            Assert.IsNull(quoteBar);\n+\n+            var bar2 = new QuoteBar\n+            {\n+                Time = time + TimeSpan.FromMinutes(1),\n+                Symbol = Symbols.SPY,\n+                Bid = new Bar(1.1m, 2.2m, 0.9m, 2.1m),\n+                LastBidSize = 3,\n+                Ask = new Bar(2.2m, 4.4m, 3.3m, 3.3m),\n+                LastAskSize = 0,\n+                Value = 1,\n+                Period = period\n+            };\n+            creator.Update(bar2);\n+\n+            // pushing another bar to force the fire\n+            var bar3 = new QuoteBar","path":"Tests/Common/Data/QuoteBarConsolidatorTests.cs","position":122,"original_position":122,"commit_id":"f6a64a935572832d73215494e3a02f631c0feffb","original_commit_id":"f6a64a935572832d73215494e3a02f631c0feffb","user":{"login":"Worthy7","id":4762399,"avatar_url":"https://avatars3.githubusercontent.com/u/4762399?v=4","gravatar_id":"","url":"https://api.github.com/users/Worthy7","html_url":"https://github.com/Worthy7","followers_url":"https://api.github.com/users/Worthy7/followers","following_url":"https://api.github.com/users/Worthy7/following{/other_user}","gists_url":"https://api.github.com/users/Worthy7/gists{/gist_id}","starred_url":"https://api.github.com/users/Worthy7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Worthy7/subscriptions","organizations_url":"https://api.github.com/users/Worthy7/orgs","repos_url":"https://api.github.com/users/Worthy7/repos","events_url":"https://api.github.com/users/Worthy7/events{/privacy}","received_events_url":"https://api.github.com/users/Worthy7/received_events","type":"User","site_admin":false},"body":"@mchandschuh Ah sorry, I `Assert.IsNotNull(quoteBar)`. Which is what ^ is referring to.\r\nWhy Assert.IsNull(quoteBar)? Surely after 2 bars it should be emitted? I don't understand why it doesn't so I left it out.","created_at":"2018-02-20T00:40:34Z","updated_at":"2018-02-20T00:40:34Z","html_url":"https://github.com/QuantConnect/Lean/pull/1547#discussion_r169195798","pull_request_url":"https://api.github.com/repos/QuantConnect/Lean/pulls/1547","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/QuantConnect/Lean/pulls/comments/169195798"},"html":{"href":"https://github.com/QuantConnect/Lean/pull/1547#discussion_r169195798"},"pull_request":{"href":"https://api.github.com/repos/QuantConnect/Lean/pulls/1547"}},"in_reply_to_id":169173022},"pull_request":{"url":"https://api.github.com/repos/QuantConnect/Lean/pulls/1547","id":168127331,"html_url":"https://github.com/QuantConnect/Lean/pull/1547","diff_url":"https://github.com/QuantConnect/Lean/pull/1547.diff","patch_url":"https://github.com/QuantConnect/Lean/pull/1547.patch","issue_url":"https://api.github.com/repos/QuantConnect/Lean/issues/1547","number":1547,"state":"open","locked":false,"title":"Fixed EndTime/Period on QuoteBar","user":{"login":"Worthy7","id":4762399,"avatar_url":"https://avatars3.githubusercontent.com/u/4762399?v=4","gravatar_id":"","url":"https://api.github.com/users/Worthy7","html_url":"https://github.com/Worthy7","followers_url":"https://api.github.com/users/Worthy7/followers","following_url":"https://api.github.com/users/Worthy7/following{/other_user}","gists_url":"https://api.github.com/users/Worthy7/gists{/gist_id}","starred_url":"https://api.github.com/users/Worthy7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Worthy7/subscriptions","organizations_url":"https://api.github.com/users/Worthy7/orgs","repos_url":"https://api.github.com/users/Worthy7/repos","events_url":"https://api.github.com/users/Worthy7/events{/privacy}","received_events_url":"https://api.github.com/users/Worthy7/received_events","type":"User","site_admin":false},"body":"When a consolidator is used, the produced `QuoteBar` does not have the Period/EndTime set, and thus always appears as a 1 minute bar. I believe this is exclusive to QuoteBar Consolidators.\r\n\r\nThis is my fix, I can only confirm that it fixed my problem but have tried to fix all of the aggregators too, to try and save some work for people. It needs a review from someone in the know.\r\n","created_at":"2018-02-09T00:48:22Z","updated_at":"2018-02-20T00:40:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"11f7d735a0cf0620aa8c85c2687aee8a7b0f8d65","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/QuantConnect/Lean/pulls/1547/commits","review_comments_url":"https://api.github.com/repos/QuantConnect/Lean/pulls/1547/comments","review_comment_url":"https://api.github.com/repos/QuantConnect/Lean/pulls/comments{/number}","comments_url":"https://api.github.com/repos/QuantConnect/Lean/issues/1547/comments","statuses_url":"https://api.github.com/repos/QuantConnect/Lean/statuses/f6a64a935572832d73215494e3a02f631c0feffb","head":{"label":"Worthy7:ConsolidatorPeriodsFix","ref":"ConsolidatorPeriodsFix","sha":"f6a64a935572832d73215494e3a02f631c0feffb","user":{"login":"Worthy7","id":4762399,"avatar_url":"https://avatars3.githubusercontent.com/u/4762399?v=4","gravatar_id":"","url":"https://api.github.com/users/Worthy7","html_url":"https://github.com/Worthy7","followers_url":"https://api.github.com/users/Worthy7/followers","following_url":"https://api.github.com/users/Worthy7/following{/other_user}","gists_url":"https://api.github.com/users/Worthy7/gists{/gist_id}","starred_url":"https://api.github.com/users/Worthy7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Worthy7/subscriptions","organizations_url":"https://api.github.com/users/Worthy7/orgs","repos_url":"https://api.github.com/users/Worthy7/repos","events_url":"https://api.github.com/users/Worthy7/events{/privacy}","received_events_url":"https://api.github.com/users/Worthy7/received_events","type":"User","site_admin":false},"repo":{"id":117938762,"name":"Lean","full_name":"Worthy7/Lean","owner":{"login":"Worthy7","id":4762399,"avatar_url":"https://avatars3.githubusercontent.com/u/4762399?v=4","gravatar_id":"","url":"https://api.github.com/users/Worthy7","html_url":"https://github.com/Worthy7","followers_url":"https://api.github.com/users/Worthy7/followers","following_url":"https://api.github.com/users/Worthy7/following{/other_user}","gists_url":"https://api.github.com/users/Worthy7/gists{/gist_id}","starred_url":"https://api.github.com/users/Worthy7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Worthy7/subscriptions","organizations_url":"https://api.github.com/users/Worthy7/orgs","repos_url":"https://api.github.com/users/Worthy7/repos","events_url":"https://api.github.com/users/Worthy7/events{/privacy}","received_events_url":"https://api.github.com/users/Worthy7/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Worthy7/Lean","description":"Lean Algorithmic Trading Engine by QuantConnect (C#, Python, F#)","fork":true,"url":"https://api.github.com/repos/Worthy7/Lean","forks_url":"https://api.github.com/repos/Worthy7/Lean/forks","keys_url":"https://api.github.com/repos/Worthy7/Lean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Worthy7/Lean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Worthy7/Lean/teams","hooks_url":"https://api.github.com/repos/Worthy7/Lean/hooks","issue_events_url":"https://api.github.com/repos/Worthy7/Lean/issues/events{/number}","events_url":"https://api.github.com/repos/Worthy7/Lean/events","assignees_url":"https://api.github.com/repos/Worthy7/Lean/assignees{/user}","branches_url":"https://api.github.com/repos/Worthy7/Lean/branches{/branch}","tags_url":"https://api.github.com/repos/Worthy7/Lean/tags","blobs_url":"https://api.github.com/repos/Worthy7/Lean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Worthy7/Lean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Worthy7/Lean/git/refs{/sha}","trees_url":"https://api.github.com/repos/Worthy7/Lean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Worthy7/Lean/statuses/{sha}","languages_url":"https://api.github.com/repos/Worthy7/Lean/languages","stargazers_url":"https://api.github.com/repos/Worthy7/Lean/stargazers","contributors_url":"https://api.github.com/repos/Worthy7/Lean/contributors","subscribers_url":"https://api.github.com/repos/Worthy7/Lean/subscribers","subscription_url":"https://api.github.com/repos/Worthy7/Lean/subscription","commits_url":"https://api.github.com/repos/Worthy7/Lean/commits{/sha}","git_commits_url":"https://api.github.com/repos/Worthy7/Lean/git/commits{/sha}","comments_url":"https://api.github.com/repos/Worthy7/Lean/comments{/number}","issue_comment_url":"https://api.github.com/repos/Worthy7/Lean/issues/comments{/number}","contents_url":"https://api.github.com/repos/Worthy7/Lean/contents/{+path}","compare_url":"https://api.github.com/repos/Worthy7/Lean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Worthy7/Lean/merges","archive_url":"https://api.github.com/repos/Worthy7/Lean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Worthy7/Lean/downloads","issues_url":"https://api.github.com/repos/Worthy7/Lean/issues{/number}","pulls_url":"https://api.github.com/repos/Worthy7/Lean/pulls{/number}","milestones_url":"https://api.github.com/repos/Worthy7/Lean/milestones{/number}","notifications_url":"https://api.github.com/repos/Worthy7/Lean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Worthy7/Lean/labels{/name}","releases_url":"https://api.github.com/repos/Worthy7/Lean/releases{/id}","deployments_url":"https://api.github.com/repos/Worthy7/Lean/deployments","created_at":"2018-01-18T05:52:38Z","updated_at":"2018-01-18T05:52:46Z","pushed_at":"2018-02-14T08:18:31Z","git_url":"git://github.com/Worthy7/Lean.git","ssh_url":"git@github.com:Worthy7/Lean.git","clone_url":"https://github.com/Worthy7/Lean.git","svn_url":"https://github.com/Worthy7/Lean","homepage":"https://www.quantconnect.com/lean","size":196177,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":null,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"QuantConnect:master","ref":"master","sha":"c04b0c986f0395a1cc60b6c6b2d7c5b48ce19e21","user":{"login":"QuantConnect","id":3912814,"avatar_url":"https://avatars0.githubusercontent.com/u/3912814?v=4","gravatar_id":"","url":"https://api.github.com/users/QuantConnect","html_url":"https://github.com/QuantConnect","followers_url":"https://api.github.com/users/QuantConnect/followers","following_url":"https://api.github.com/users/QuantConnect/following{/other_user}","gists_url":"https://api.github.com/users/QuantConnect/gists{/gist_id}","starred_url":"https://api.github.com/users/QuantConnect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuantConnect/subscriptions","organizations_url":"https://api.github.com/users/QuantConnect/orgs","repos_url":"https://api.github.com/users/QuantConnect/repos","events_url":"https://api.github.com/users/QuantConnect/events{/privacy}","received_events_url":"https://api.github.com/users/QuantConnect/received_events","type":"Organization","site_admin":false},"repo":{"id":27251463,"name":"Lean","full_name":"QuantConnect/Lean","owner":{"login":"QuantConnect","id":3912814,"avatar_url":"https://avatars0.githubusercontent.com/u/3912814?v=4","gravatar_id":"","url":"https://api.github.com/users/QuantConnect","html_url":"https://github.com/QuantConnect","followers_url":"https://api.github.com/users/QuantConnect/followers","following_url":"https://api.github.com/users/QuantConnect/following{/other_user}","gists_url":"https://api.github.com/users/QuantConnect/gists{/gist_id}","starred_url":"https://api.github.com/users/QuantConnect/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuantConnect/subscriptions","organizations_url":"https://api.github.com/users/QuantConnect/orgs","repos_url":"https://api.github.com/users/QuantConnect/repos","events_url":"https://api.github.com/users/QuantConnect/events{/privacy}","received_events_url":"https://api.github.com/users/QuantConnect/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/QuantConnect/Lean","description":"Lean Algorithmic Trading Engine by QuantConnect (C#, Python, F#)","fork":false,"url":"https://api.github.com/repos/QuantConnect/Lean","forks_url":"https://api.github.com/repos/QuantConnect/Lean/forks","keys_url":"https://api.github.com/repos/QuantConnect/Lean/keys{/key_id}","collaborators_url":"https://api.github.com/repos/QuantConnect/Lean/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/QuantConnect/Lean/teams","hooks_url":"https://api.github.com/repos/QuantConnect/Lean/hooks","issue_events_url":"https://api.github.com/repos/QuantConnect/Lean/issues/events{/number}","events_url":"https://api.github.com/repos/QuantConnect/Lean/events","assignees_url":"https://api.github.com/repos/QuantConnect/Lean/assignees{/user}","branches_url":"https://api.github.com/repos/QuantConnect/Lean/branches{/branch}","tags_url":"https://api.github.com/repos/QuantConnect/Lean/tags","blobs_url":"https://api.github.com/repos/QuantConnect/Lean/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/QuantConnect/Lean/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/QuantConnect/Lean/git/refs{/sha}","trees_url":"https://api.github.com/repos/QuantConnect/Lean/git/trees{/sha}","statuses_url":"https://api.github.com/repos/QuantConnect/Lean/statuses/{sha}","languages_url":"https://api.github.com/repos/QuantConnect/Lean/languages","stargazers_url":"https://api.github.com/repos/QuantConnect/Lean/stargazers","contributors_url":"https://api.github.com/repos/QuantConnect/Lean/contributors","subscribers_url":"https://api.github.com/repos/QuantConnect/Lean/subscribers","subscription_url":"https://api.github.com/repos/QuantConnect/Lean/subscription","commits_url":"https://api.github.com/repos/QuantConnect/Lean/commits{/sha}","git_commits_url":"https://api.github.com/repos/QuantConnect/Lean/git/commits{/sha}","comments_url":"https://api.github.com/repos/QuantConnect/Lean/comments{/number}","issue_comment_url":"https://api.github.com/repos/QuantConnect/Lean/issues/comments{/number}","contents_url":"https://api.github.com/repos/QuantConnect/Lean/contents/{+path}","compare_url":"https://api.github.com/repos/QuantConnect/Lean/compare/{base}...{head}","merges_url":"https://api.github.com/repos/QuantConnect/Lean/merges","archive_url":"https://api.github.com/repos/QuantConnect/Lean/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/QuantConnect/Lean/downloads","issues_url":"https://api.github.com/repos/QuantConnect/Lean/issues{/number}","pulls_url":"https://api.github.com/repos/QuantConnect/Lean/pulls{/number}","milestones_url":"https://api.github.com/repos/QuantConnect/Lean/milestones{/number}","notifications_url":"https://api.github.com/repos/QuantConnect/Lean/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/QuantConnect/Lean/labels{/name}","releases_url":"https://api.github.com/repos/QuantConnect/Lean/releases{/id}","deployments_url":"https://api.github.com/repos/QuantConnect/Lean/deployments","created_at":"2014-11-28T04:20:19Z","updated_at":"2018-02-19T14:42:58Z","pushed_at":"2018-02-19T20:42:35Z","git_url":"git://github.com/QuantConnect/Lean.git","ssh_url":"git@github.com:QuantConnect/Lean.git","clone_url":"https://github.com/QuantConnect/Lean.git","svn_url":"https://github.com/QuantConnect/Lean","homepage":"http://lean.io","size":196155,"stargazers_count":1448,"watchers_count":1448,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":841,"mirror_url":null,"archived":false,"open_issues_count":81,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0"},"forks":841,"open_issues":81,"watchers":1448,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/QuantConnect/Lean/pulls/1547"},"html":{"href":"https://github.com/QuantConnect/Lean/pull/1547"},"issue":{"href":"https://api.github.com/repos/QuantConnect/Lean/issues/1547"},"comments":{"href":"https://api.github.com/repos/QuantConnect/Lean/issues/1547/comments"},"review_comments":{"href":"https://api.github.com/repos/QuantConnect/Lean/pulls/1547/comments"},"review_comment":{"href":"https://api.github.com/repos/QuantConnect/Lean/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/QuantConnect/Lean/pulls/1547/commits"},"statuses":{"href":"https://api.github.com/repos/QuantConnect/Lean/statuses/f6a64a935572832d73215494e3a02f631c0feffb"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"Worthy7"}}