ctubio / tribeca

Self-hosted crypto trading bot (automated high frequency market making) in node.js, angular, typescript and c++
https://127.0.0.1:3000
Other
95 stars 26 forks source link

Can not connect to OkCoin #85

Closed viperzero closed 7 years ago

viperzero commented 7 years ago

After upgrading to latest version I can not connect anymore to OkCoin. Web gui does load and it says: Disconnected from exchange Can not connect through Okcoin button. Log is empty. Little clueless how to proceed.

app exchange: OkCoin/BTC/USD
app version: undisclosed

300px-spock_vulcan-salute3

ctubio commented 7 years ago

to see the log please run the app without forever, that is:

$ nodejs tribeca.js

cos now we only output the log messages to stdout, so we dont have a log file anymore

maybe can you copy here your error? i know there is some situation where OkCoin fails to start, but this doesnt happens always so trying to start it again may work.

let see if we both are experiencing the same error, or if yours is a new one, thanks for your help'¡

ctubio commented 7 years ago

are you running the latest commit? im not able to reproduce the error i was talking about anymore :( please provide an error report so i can follow the bug, many thanks'¡

viperzero commented 7 years ago

This started to happen yesterday after I upgraded and now updated to latest commit. Here's the output, seems heartbeat is lost:

{"name":"tribeca:gateway:OkCoinWebsocket","hostname":"ubuntu-512mb-toronto","pid":9018,"level":30,"msg":"OkCoin heartbeat lost.","time":"2017-05-17T18:15:53.247Z","v":0} {"name":"stdev","hostname":"ubuntu-512mb-toronto","pid":9018,"level":30,"msg":"Unable to compute STDEV value","time":"2017-05-17T18:15:53.593Z","v":0} {"name":"stdev","hostname":"ubuntu-512mb-toronto","pid":9018,"level":30,"msg":"Unable to compute STDEV value","time":"2017-05-17T18:15:54.593Z","v":0} {"name":"stdev","hostname":"ubuntu-512mb-toronto","pid":9018,"level":30,"msg":"Unable to compute STDEV value","time":"2017-05-17T18:15:55.594Z","v":0} {"name":"stdev","hostname":"ubuntu-512mb-toronto","pid":9018,"level":30,"msg":"Unable to compute STDEV value","time":"2017-05-17T18:15:56.594Z","v":0} {"name":"stdev","hostname":"ubuntu-512mb-toronto","pid":9018,"level":30,"msg":"Unable to compute STDEV value","time":"2017-05-17T18:15:57.601Z","v":0} ^C{"name":"main","hostname":"ubuntu-512mb-toronto","pid":9018,"level":30,"msg":"Handling SIGINT","time":"2017-05-17T18:15:57.974Z","v":0} {"name":"main","hostname":"ubuntu-512mb-toronto","pid":9018,"level":30,"msg":"All exiting event handlers have fired, exiting application.","time":"2017-05-17T18:15:57.985Z","v":0} {"name":"main","hostname":"ubuntu-512mb-toronto","pid":9018,"level":30,"msg":"Exiting with code 0","time":"2017-05-17T18:15:57.988Z","v":0}

viperzero commented 7 years ago

Now after starting again with logging It started working alltough nothing changed, perhaps this is on the okcoin end issue?

{"name":"tribeca:gateway:OkCoinWebsocket","hostname":"ubuntu-512mb-toronto","pid":9076,"level":30,"msg":"Successfully connected to addChannel: ok_sub_spotusd_btc_depth_20","time":"2017-05-17T18:20:32.354Z","v":0} {"name":"positionmanager","hostname":"ubuntu-512mb-toronto","pid":9076,"level":30,"msg":"recalculated target base position: 0","time":"2017-05-17T18:20:32.367Z","v":0} {"name":"tribeca:gateway:OkCoinWebsocket","hostname":"ubuntu-512mb-toronto","pid":9076,"level":30,"msg":"Successfully connected to addChannel: ok_sub_spotusd_btc_trades","time":"2017-05-17T18:20:32.368Z","v":0} {"name":"tribeca:gateway:OkCoinWebsocket","hostname":"ubuntu-512mb-toronto","pid":9076,"level":30,"msg":"Successfully connected to login","time":"2017-05-17T18:20:32.488Z","v":0} {"name":"positionmanager","hostname":"ubuntu-512mb-toronto","pid":9076,"level":30,"msg":"recalculated target base position: 0.2155265","time":"2017-05-17T18:20:32.542Z","v":0}

ctubio commented 7 years ago

many thanks for the logs, will try to make the app to reconnect on heartbeat lost

ctubio commented 7 years ago

added reconnect at https://github.com/ctubio/tribeca/commit/2a49c9e491bd476544f7f780b519296480b8cd95

viperzero commented 7 years ago

Many thanks for the reconnect, will be testing the new version.