Galts-Gulch / avarice

Multi-Indicator Python3 OKCoin CN & Intl Trading Bot/Infrastructure
Other
91 stars 29 forks source link

Fails to live trade #21

Closed ghost closed 9 years ago

ghost commented 9 years ago

Whenever the bot attempts to trade it generates the following error.

Candle: 2524 | Price: 1527.98 cny | Time: 20:07:46 | Date: 2015/03/27 FullStochRSID: 0.0 MACD : We are in an Uptrend | Diff: -1.1946908671234269e-06 MACD Hist: 0.0002869444164193001 Exception in thread Thread-575: Traceback (most recent call last): File "C:\Python34\lib\threading.py", line 921, in _bootstrap_inner self.run() File "C:\Python34\lib\threading.py", line 1187, in run self.function(_self.args, _self.kwargs) File "C:\Avarice\genutils.py", line 16, in do_every worker_func() File "C:\Avarice\avarice.py", line 44, in RunCommon trd.TradeFromStrategy() File "C:\Avarice\trader.py", line 65, in TradeFromStrategy TradeAmount = GetTradeAmount('buy', st.Trade_dict['TradeVolume']) File "C:\Avarice\trader.py", line 20, in GetTradeAmount ((volume / 100) \ el.GetFree('currency') / el.GetMarketPrice('ask')), 3) File "C:\Avarice\exchangelayer.py", line 36, in GetFree okwspriv.userinfo())[-1]['data']['info']['funds']['free'][gc.API.Currency] File "C:\Avarice\okcoin\WebSocketAPI.py", line 74, in userinfo 'parameters':{ 'api_key':'" + self.api_key + "', 'sign':'" + sign + "'} }") File "C:\Python34\lib\site-packages\websocket_core.py", line 675, in send return self.send_frame(frame) File "C:\Python34\lib\site-packages\websocket_core.py", line 701, in send_fra me l = self._send(data) File "C:\Python34\lib\site-packages\websocket_core.py", line 912, in _send return self.sock.send(data) File "C:\Python34\lib\ssl.py", line 679, in send v = self._sslobj.write(data) ConnectionResetError: [WinError 10054] An existing connection was forcibly close d by the remote host

RealJohnGalt commented 9 years ago

Interesting. I haven't run into this recently, and have had an instance live trading for awhile now.

1) What version of the software are you running? Avarice should be catching the ConnectionResetError and trying again (at which point the exception would be a few lines lower). 2) Have you successfully live traded at all using this API key pair? Are you sure the format is correct in genconfig.py? If the format is incorrect, the config format is going to be changing shortly to something more like http://sprunge.us/EjSi at which point formatting will be handled for you.

ghost commented 9 years ago

Version I was running was 3.3.2, I just rebuilt my computer last night after I reported this issue (new computer) and will be transitioning to 4.0.1.

I have successfully traded using this API key pair, but not since version 3.1.0.

RealJohnGalt commented 9 years ago

Please let me know how it goes and keep me updated. If there is another major trading issue like this, I'd like to catch it quickly. Thank you again.

ghost commented 9 years ago

Will do, I'm getting ready to get the Bot up and running again. I'll definitely let you know if I encounter that error again.

ghost commented 9 years ago

New key pair, and Bot has made a trade. So this wasn't an issue with the bot, not sure what was going on with the key. But deleting it and creating a new pair solved it.

RealJohnGalt commented 9 years ago

I believe this issue is fixed, or at least current live trade issues have to do with websocket connection issues. closing for now.