MohammedRashad / Crypto-Copy-Trader

A copy trading tool for cryptocurrencies - Binance Exchange
Apache License 2.0
202 stars 86 forks source link

Issue in Order Cancellation #30

Closed zakirattari26 closed 4 years ago

zakirattari26 commented 4 years ago

Creating Issue while cancelling the order from Master. Order did not cancel from Slave.

zakirattari26 commented 4 years ago

Unhandled Error Traceback (most recent call last): File "C:\Python37\lib\site-packages\twisted\python\log.py", line 103, in callWithLogger return callWithContext({"system": lp}, func, *args, kw) File "C:\Python37\lib\site-packages\twisted\python\log.py", line 86, in callWithContext return context.call({ILogContext: newCtx}, func, *args, *kw) File "C:\Python37\lib\site-packages\twisted\python\context.py", line 122, in callWithContext return self.currentContext().callWithContext(ctx, func, args, kw) File "C:\Python37\lib\site-packages\twisted\python\context.py", line 85, in callWithContext return func(*args,kw) --- --- File "C:\Python37\lib\site-packages\twisted\internet\selectreactor.py", line 149, in _doReadOrWrite why = getattr(selectable, method)() File "C:\Python37\lib\site-packages\twisted\internet\tcp.py", line 243, in doRead return self._dataReceived(data) File "C:\Python37\lib\site-packages\twisted\internet\tcp.py", line 249, in _dataReceived rval = self.protocol.dataReceived(data) File "C:\Python37\lib\site-packages\twisted\protocols\tls.py", line 330, in dataReceived self._flushReceiveBIO() File "C:\Python37\lib\site-packages\twisted\protocols\tls.py", line 295, in _flushReceiveBIO ProtocolWrapper.dataReceived(self, bytes) File "C:\Python37\lib\site-packages\twisted\protocols\policies.py", line 120, in dataReceived self.wrappedProtocol.dataReceived(data) File "C:\Python37\lib\site-packages\autobahn\twisted\websocket.py", line 290, in dataReceived self._dataReceived(data) File "C:\Python37\lib\site-packages\autobahn\websocket\protocol.py", line 1206, in _dataReceived self.consumeData() File "C:\Python37\lib\site-packages\autobahn\websocket\protocol.py", line 1218, in consumeData while self.processData() and self.state != WebSocketProtocol.STATE_CLOSED: File "C:\Python37\lib\site-packages\autobahn\websocket\protocol.py", line 1578, in processData fr = self.onFrameEnd() File "C:\Python37\lib\site-packages\autobahn\websocket\protocol.py", line 1703, in onFrameEnd self._onMessageEnd() File "C:\Python37\lib\site-packages\autobahn\twisted\websocket.py", line 318, in _onMessageEnd self.onMessageEnd() File "C:\Python37\lib\site-packages\autobahn\websocket\protocol.py", line 627, in onMessageEnd self._onMessage(payload, self.message_is_binary) File "C:\Python37\lib\site-packages\autobahn\twisted\websocket.py", line 321, in _onMessage self.onMessage(payload, isBinary) File "C:\Python37\lib\site-packages\binance\websockets.py", line 32, in onMessage self.factory.callback(payload_obj) File "C:\Crypto-Copy-Trader-master\SlaveContainer.py", line 49, in on_order_caller asyncio.run(slave.on_order_handler(order_event)) File "C:\Python37\lib\asyncio\runners.py", line 43, in run return loop.run_until_complete(main) File "C:\Python37\lib\asyncio\base_events.py", line 568, in run_until_complete return future.result() File "C:\Crypto-Copy-Trader-master\ExchangeInterfaces\BinanceExchange.py", line 61, in on_order_handler self.cancel_order(event['s'], slave_order_id) File "C:\Crypto-Copy-Trader-master\ExchangeInterfaces\BinanceExchange.py", line 43, in cancel_order self.connection.cancel_order(symbol=symbol, orderId=orderId) File "C:\Python37\lib\site-packages\binance\client.py", line 1501, in cancel_order return self._delete('order', True, data=params) File "C:\Python37\lib\site-packages\binance\client.py", line 231, in _delete return self._request_api('delete', path, signed, version, kwargs) File "C:\Python37\lib\site-packages\binance\client.py", line 191, in _request_api return self._request(method, uri, signed, **kwargs) File "C:\Python37\lib\site-packages\binance\client.py", line 186, in _request return self._handle_response() File "C:\Python37\lib\site-packages\binance\client.py", line 215, in _handle_response raise BinanceAPIException(self.response) binance.exceptions.BinanceAPIException: APIError(code=-1022): Signature for this request is not valid.

Unhandled Error Traceback (most recent call last): File "C:\Python37\lib\site-packages\binance\websockets.py", line 586, in run reactor.run(installSignalHandlers=False) File "C:\Python37\lib\site-packages\twisted\internet\base.py", line 1283, in run self.mainLoop() File "C:\Python37\lib\site-packages\twisted\internet\base.py", line 1295, in mainLoop self.doIteration(t) File "C:\Python37\lib\site-packages\twisted\internet\selectreactor.py", line 143, in doSelect _logrun(selectable, _drdw, selectable, method) --- --- File "C:\Python37\lib\site-packages\twisted\python\log.py", line 103, in callWithLogger return callWithContext({"system": lp}, func, *args, kw) File "C:\Python37\lib\site-packages\twisted\python\log.py", line 86, in callWithContext return context.call({ILogContext: newCtx}, func, *args, *kw) File "C:\Python37\lib\site-packages\twisted\python\context.py", line 122, in callWithContext return self.currentContext().callWithContext(ctx, func, args, kw) File "C:\Python37\lib\site-packages\twisted\python\context.py", line 85, in callWithContext return func(*args,**kw) File "C:\Python37\lib\site-packages\twisted\internet\selectreactor.py", line 154, in _doReadOrWrite self._disconnectSelectable(selectable, why, method=="doRead") File "C:\Python37\lib\site-packages\twisted\internet\posixbase.py", line 258, in _disconnectSelectable selectable.connectionLost(failure.Failure(why)) File "C:\Python37\lib\site-packages\twisted\internet\tcp.py", line 519, in connectionLost self._commonConnection.connectionLost(self, reason) File "C:\Python37\lib\site-packages\twisted\internet\tcp.py", line 327, in connectionLost protocol.connectionLost(reason) File "C:\Python37\lib\site-packages\twisted\protocols\tls.py", line 398, in connectionLost self._flushReceiveBIO() File "C:\Python37\lib\site-packages\twisted\protocols\tls.py", line 295, in _flushReceiveBIO ProtocolWrapper.dataReceived(self, bytes) File "C:\Python37\lib\site-packages\twisted\protocols\policies.py", line 120, in dataReceived self.wrappedProtocol.dataReceived(data) File "C:\Python37\lib\site-packages\autobahn\twisted\websocket.py", line 290, in dataReceived self._dataReceived(data) File "C:\Python37\lib\site-packages\autobahn\websocket\protocol.py", line 1206, in _dataReceived self.consumeData() File "C:\Python37\lib\site-packages\autobahn\websocket\protocol.py", line 1218, in consumeData while self.processData() and self.state != WebSocketProtocol.STATE_CLOSED: File "C:\Python37\lib\site-packages\autobahn\websocket\protocol.py", line 1570, in processData fr = self.onFrameData(payload) File "C:\Python37\lib\site-packages\autobahn\websocket\protocol.py", line 1665, in onFrameData self._onMessageFrameData(payload) File "C:\Python37\lib\site-packages\autobahn\twisted\websocket.py", line 309, in _onMessageFrameData self.onMessageFrameData(payload) File "C:\Python37\lib\site-packages\autobahn\websocket\protocol.py", line 601, in onMessageFrameData self.frame_data.append(payload) builtins.AttributeError: 'NoneType' object has no attribute 'append'

mokolotron commented 4 years ago

Sorry for the long absence. I didn't have time to support the project. When Pullrequest is accepted the bug will be fixed. But you will need to switch and update to develop branch

MohammedRashad commented 4 years ago

Pull request merged