ctubio / Krypto-trading-bot

Self-hosted crypto trading bot (automated high frequency market making) written in C++
https://127.0.0.1:3000
Other
3.37k stars 823 forks source link

hitbtc errors #101

Closed michaelr524 closed 7 years ago

michaelr524 commented 7 years ago

I see some errors when running with HitBTC. Didn't tweak any arguments, ran the defaults (after configuring API keys and related in the config file). Are these errors harmless? How to get more information (such as the line in code, which throws a given error)?

K.linux.51
13:6:58.43087 CF settings loaded from JSON file K OK.
13:6:58.430232 DB /data/db/K.1.6.0.db loaded OK.
13:6:58.430528 UI ready over HTTPS on external port 61278.
13:6:58.708426 GW hitbtc allows client IP.
13:6:58.708455 GW hitbtc:
- autoBot: no
- pair: ETHBTC
- minTick: 0.000001
- minSize: 0.001000
- makeFee: 0.000000
- takeFee: 0.000000
13:06:58.919 tbp Loaded from DB: 0.5096113192507659
13:06:59.919 stdev Unable to compute value
13:7:0.610358 1 UI currently connected, last connection was from ::1
13:07:00.919 stdev Unable to compute value
13:7:11.595627 GW hitbtc Changed quoting state to Enabled.
hitbtc unhandled message { code: 'InvalidArgument',
  message: 'Fields are not valid: price, price' }
hitbtc unhandled message { code: 'InvalidArgument',
  message: 'Fields are not valid: price, price' }
13:07:29.250 main Event loop delay 300ms
13:07:58.944 tbp recalculated 0.5054818330565212
13:07:59.373 main Event loop delay 300ms
13:08:59.351 tbp recalculated 0.49954311085534187
13:08:59.374 main Event loop delay 400ms
hitbtc unhandled message { code: 'InternalError', message: 'Internal error. Try again.' }
13:09:44.383 main Event loop delay 400ms
13:09:59.398 tbp recalculated 0.49330971845199656
13:10:14.403 main Event loop delay 300ms
michaelr524 commented 7 years ago

Additional errors, which also cause the bot to exit:

hitbtc SyntaxError: Unexpected token u in JSON at position 0
    at JSON.parse (<anonymous>)
    at HitBtcOrderEntryGateway.onMessage (/home/mich/dev/xl/cloned/Krypto-trading-bot/app/server/gateways/hitbtc.js:295:32)
    at Request.request [as _callback] (/home/mich/dev/xl/cloned/Krypto-trading-bot/app/server/gateways/hitbtc.js:193:100)
    at self.callback (/home/mich/dev/xl/cloned/Krypto-trading-bot/node_modules/request/request.js:188:22)
    at emitOne (events.js:96:13)
    at Request.emit (events.js:191:7)
    at Request.onRequestError (/home/mich/dev/xl/cloned/Krypto-trading-bot/node_modules/request/request.js:884:8)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:191:7)
    at Socket.socketErrorListener (_http_client.js:358:9) exception while processing message undefined
ctubio commented 7 years ago

im sorry im not interested into fix hitbtc issues for free

michaelr524 commented 7 years ago

I got similar errors also when tried with Poloniex. Which of the exchanges would you recommend using?

At the moment I'm just experimenting, trying to see if the bot can actually make profits.

I could contribute to development by fixing some of these bugs and adding support for additional exchanges if I see that the bot actually works.

Would love to hear your thoughts on this. @ctubio

ctubio commented 7 years ago

right right right now i do recommend okcoin

in little days gdax, bitfinex and hitbtc maybe fixed (currently gdax have memory leak, bitfinex wrong mintick, and hitbtc well you know :P); poloniex is the worst ever if you ask me and im very lazy to fix poloniex in the nearly future

ctubio commented 7 years ago

about the collaboration, you can work on your repo and i can steal your commit, or you can make PR to this repo, both work for me xD

ctubio commented 7 years ago

about the profits, its not about the bot but about the strategy you use.

for instance if you do nothing and simply hold all your btc, if market goes up you will make profit, still without bot doing nothing. If you let the bot do something, it will increase or decrease your final profit; but is not because of the bot but because of your strategy.