{"action":"created","issue":{"url":"https://api.github.com/repos/QuantConnect/Lean/issues/457","repository_url":"https://api.github.com/repos/QuantConnect/Lean","labels_url":"https://api.github.com/repos/QuantConnect/Lean/issues/457/labels{/name}","comments_url":"https://api.github.com/repos/QuantConnect/Lean/issues/457/comments","events_url":"https://api.github.com/repos/QuantConnect/Lean/issues/457/events","html_url":"https://github.com/QuantConnect/Lean/issues/457","id":164209860,"number":457,"title":"Lot size rounding orders to 0, then submitting 0-quantity orders.","user":{"login":"jaredbroad","id":2243225,"avatar_url":"https://avatars.githubusercontent.com/u/2243225?v=3","gravatar_id":"","url":"https://api.github.com/users/jaredbroad","html_url":"https://github.com/jaredbroad","followers_url":"https://api.github.com/users/jaredbroad/followers","following_url":"https://api.github.com/users/jaredbroad/following{/other_user}","gists_url":"https://api.github.com/users/jaredbroad/gists{/gist_id}","starred_url":"https://api.github.com/users/jaredbroad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaredbroad/subscriptions","organizations_url":"https://api.github.com/users/jaredbroad/orgs","repos_url":"https://api.github.com/users/jaredbroad/repos","events_url":"https://api.github.com/users/jaredbroad/events{/privacy}","received_events_url":"https://api.github.com/users/jaredbroad/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/QuantConnect/Lean/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"mchandschuh","id":531416,"avatar_url":"https://avatars.githubusercontent.com/u/531416?v=3","gravatar_id":"","url":"https://api.github.com/users/mchandschuh","html_url":"https://github.com/mchandschuh","followers_url":"https://api.github.com/users/mchandschuh/followers","following_url":"https://api.github.com/users/mchandschuh/following{/other_user}","gists_url":"https://api.github.com/users/mchandschuh/gists{/gist_id}","starred_url":"https://api.github.com/users/mchandschuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mchandschuh/subscriptions","organizations_url":"https://api.github.com/users/mchandschuh/orgs","repos_url":"https://api.github.com/users/mchandschuh/repos","events_url":"https://api.github.com/users/mchandschuh/events{/privacy}","received_events_url":"https://api.github.com/users/mchandschuh/received_events","type":"User","site_admin":false},"assignees":[{"login":"mchandschuh","id":531416,"avatar_url":"https://avatars.githubusercontent.com/u/531416?v=3","gravatar_id":"","url":"https://api.github.com/users/mchandschuh","html_url":"https://github.com/mchandschuh","followers_url":"https://api.github.com/users/mchandschuh/followers","following_url":"https://api.github.com/users/mchandschuh/following{/other_user}","gists_url":"https://api.github.com/users/mchandschuh/gists{/gist_id}","starred_url":"https://api.github.com/users/mchandschuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mchandschuh/subscriptions","organizations_url":"https://api.github.com/users/mchandschuh/orgs","repos_url":"https://api.github.com/users/mchandschuh/repos","events_url":"https://api.github.com/users/mchandschuh/events{/privacy}","received_events_url":"https://api.github.com/users/mchandschuh/received_events","type":"User","site_admin":false}],"milestone":null,"comments":1,"created_at":"2016-07-07T01:23:12Z","updated_at":"2016-07-08T01:26:42Z","closed_at":null,"body":"Issue when submitting an order with quantity less than the lot size; then its rounded to 0 after the sanity checks. Then the 0-quantity order is submitted.\r\n\r\nE.g. FXCM lot size 1k, submit order for 200 EUR, rounded to 0 but submitted anyway (and changed fees)\r\n\r\nShould probably perform a non-zero check after rounding the order; &/or; round the lot size earlier in the process and check it still passes the non-zero check\r\n\r\n![2016-07-06 18_09_58-algorithmic trading platform - quantconnect com](https://cloud.githubusercontent.com/assets/2243225/16639676/d3c934d4-43bf-11e6-8644-012dfd5591aa.png)\r\n"},"comment":{"url":"https://api.github.com/repos/QuantConnect/Lean/issues/comments/231253312","html_url":"https://github.com/QuantConnect/Lean/issues/457#issuecomment-231253312","issue_url":"https://api.github.com/repos/QuantConnect/Lean/issues/457","id":231253312,"user":{"login":"mchandschuh","id":531416,"avatar_url":"https://avatars.githubusercontent.com/u/531416?v=3","gravatar_id":"","url":"https://api.github.com/users/mchandschuh","html_url":"https://github.com/mchandschuh","followers_url":"https://api.github.com/users/mchandschuh/followers","following_url":"https://api.github.com/users/mchandschuh/following{/other_user}","gists_url":"https://api.github.com/users/mchandschuh/gists{/gist_id}","starred_url":"https://api.github.com/users/mchandschuh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mchandschuh/subscriptions","organizations_url":"https://api.github.com/users/mchandschuh/orgs","repos_url":"https://api.github.com/users/mchandschuh/repos","events_url":"https://api.github.com/users/mchandschuh/events{/privacy}","received_events_url":"https://api.github.com/users/mchandschuh/received_events","type":"User","site_admin":false},"created_at":"2016-07-08T01:26:42Z","updated_at":"2016-07-08T01:26:42Z","body":"Some comments/thoughts/recommendations:\r\n\r\nThe method `BrokerageTransactionHandler.RoundOffOrder` seems misplaced and hard coded. Recommend moving to concern to `IBrokerageModel` via a new method -- `IBrokerageModel.PrepareSubmitOrderRequest(Security, SubmitOrderRequest)` (naming suggestions welcomed) -- which would give the model a chance to modify the request as soon as its created in the algorithm. This will allow the behavior to be pluggable and then also be subject to the various sanity checks within the algorithm.\r\n\r\nWe don't call `algorithm.BrokerageModel.CanSubmitOrder` in live mode. The documentation for the interface method seems to indicate its there to support things such as connectivity and size restrictions. Recommend allowing this logic to execute even in live mode, which will provide better consistency between backtest/live modes. This does not directly impact this bug, but is worth noting nevertheless.\r\n\r\n@jaredbroad Let me know what you think and I can get started on this."}}
{"actor":{"display_login":"mchandschuh"}}