{"action":"created","issue":{"url":"https://api.github.com/repos/Galts-Gulch/avarice/issues/17","labels_url":"https://api.github.com/repos/Galts-Gulch/avarice/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/Galts-Gulch/avarice/issues/17/comments","events_url":"https://api.github.com/repos/Galts-Gulch/avarice/issues/17/events","html_url":"https://github.com/Galts-Gulch/avarice/issues/17","id":60845137,"number":17,"title":"Real trade error","user":{"login":"Sim-fo","id":8295555,"avatar_url":"https://avatars.githubusercontent.com/u/8295555?v=3","gravatar_id":"","url":"https://api.github.com/users/Sim-fo","html_url":"https://github.com/Sim-fo","followers_url":"https://api.github.com/users/Sim-fo/followers","following_url":"https://api.github.com/users/Sim-fo/following{/other_user}","gists_url":"https://api.github.com/users/Sim-fo/gists{/gist_id}","starred_url":"https://api.github.com/users/Sim-fo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sim-fo/subscriptions","organizations_url":"https://api.github.com/users/Sim-fo/orgs","repos_url":"https://api.github.com/users/Sim-fo/repos","events_url":"https://api.github.com/users/Sim-fo/events{/privacy}","received_events_url":"https://api.github.com/users/Sim-fo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"RealJohnGalt","id":7730016,"avatar_url":"https://avatars.githubusercontent.com/u/7730016?v=3","gravatar_id":"","url":"https://api.github.com/users/RealJohnGalt","html_url":"https://github.com/RealJohnGalt","followers_url":"https://api.github.com/users/RealJohnGalt/followers","following_url":"https://api.github.com/users/RealJohnGalt/following{/other_user}","gists_url":"https://api.github.com/users/RealJohnGalt/gists{/gist_id}","starred_url":"https://api.github.com/users/RealJohnGalt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/RealJohnGalt/subscriptions","organizations_url":"https://api.github.com/users/RealJohnGalt/orgs","repos_url":"https://api.github.com/users/RealJohnGalt/repos","events_url":"https://api.github.com/users/RealJohnGalt/events{/privacy}","received_events_url":"https://api.github.com/users/RealJohnGalt/received_events","type":"User","site_admin":false},"milestone":null,"comments":18,"created_at":"2015-03-12T16:15:56Z","updated_at":"2015-03-21T10:05:45Z","closed_at":null,"body":"Unfortunately, the third version of the program (v3.2.0) is stable in simulator mode only. During the real trade I get this error:\r\n\r\n    Future/Task exception was never retrieved\r\n    future: Task(<TradeWrapper>)<exception=KeyError('data',)>\r\n    Traceback (most recent call last):\r\n      File \"/home/ubuntu/workspace/okcoin/WebSocketAPI.py\", line 112, in trade\r\n        self.ws.recv())[-1]['data']['order_id']\r\n    KeyError: 'data'\r\n\r\n    During handling of the above exception, another exception occurred:\r\n\r\n    Traceback (most recent call last):\r\n      File \"/usr/lib/python3.4/asyncio/tasks.py\", line 302, in _step\r\n        result = next(coro)\r\n      File \"/home/ubuntu/workspace/trader.py\", line 46, in TradeWrapper\r\n        el.Trade(trd.LastOrder['order'], CurrPrice, TradeAmount)\r\n      File \"/home/ubuntu/workspace/exchangelayer.py\", line 60, in Trade\r\n        okwspriv.trade(order, rate, amount)\r\n      File \"/home/ubuntu/workspace/okcoin/WebSocketAPI.py\", line 121, in trade\r\n        self.ws.recv())[-1]['data']['order_id']\r\n    KeyError: 'data'\r\n\r\n\r\nThe trading is stoping after that error, though the bot thinks that transaction are ok, the terminal displays messages about buying and selling, but transactions in the okcoin do not committed.\r\n\r\nThe error does not appear immediately, usually after two or three successful transactions.\r\n\r\nI'm getting the same errors on three different computers with OS Windows 8.1, LinuxMint and with a virtual Ubuntu workspace in the cloud (https://c9.io) \r\n\r\nVersion 2.0 of the program is stable in all modes and places.\r\n\r\nI noticed one more bug. In my settings DiffDown set to -0.02 / 0.02, but transactions are done before that value:\r\n\r\n    EMA: We are in an Uptrend | Diff: 0.0017436253469297104\r\n    StdDev: 0.6119622860161978\r\n    BUYING 1.98 btc at 1834.46 cny\r\n\r\nSorry for possible mistakes in English"},"comment":{"url":"https://api.github.com/repos/Galts-Gulch/avarice/issues/comments/84295848","html_url":"https://github.com/Galts-Gulch/avarice/issues/17#issuecomment-84295848","issue_url":"https://api.github.com/repos/Galts-Gulch/avarice/issues/17","id":84295848,"user":{"login":"Sim-fo","id":8295555,"avatar_url":"https://avatars.githubusercontent.com/u/8295555?v=3","gravatar_id":"","url":"https://api.github.com/users/Sim-fo","html_url":"https://github.com/Sim-fo","followers_url":"https://api.github.com/users/Sim-fo/followers","following_url":"https://api.github.com/users/Sim-fo/following{/other_user}","gists_url":"https://api.github.com/users/Sim-fo/gists{/gist_id}","starred_url":"https://api.github.com/users/Sim-fo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Sim-fo/subscriptions","organizations_url":"https://api.github.com/users/Sim-fo/orgs","repos_url":"https://api.github.com/users/Sim-fo/repos","events_url":"https://api.github.com/users/Sim-fo/events{/privacy}","received_events_url":"https://api.github.com/users/Sim-fo/received_events","type":"User","site_admin":false},"created_at":"2015-03-21T10:05:45Z","updated_at":"2015-03-21T10:05:45Z","body":"Thank you! During 5 hours there haven't occured any errors. Touch wood :) "}}