DeviaVir / zenbot

Zenbot is a command-line cryptocurrency trading bot using Node.js and MongoDB.
MIT License
8.24k stars 2.04k forks source link

Gemini backfill no longer working? #1021

Open deamonkai opened 6 years ago

deamonkai commented 6 years ago

System information

No. This has been off the Master branch for about three weeks. I cloned the master branch again this morning and same results.

Linux Ubuntu 17.10, but have reproduced the problem on previous versions.

Latest from master branch (4.0.5)

8.9.3

2.7.14

./zenbot.sh backfill gemini.BTC-USD -d 30

Describe the problem

Initially the problem was related to error:

"node-telegram-bot-api deprecated Automatic enabling of cancellation of promises is deprecated. In the future, you will have to enable it yourself. See https://github.com/yagop/node-telegram-bot-api/issues/319. module.js:635:30"

That was cured with "export NTBA_FIX_319=1"

Now, there is no error and nothing else happens even if I let it run for several hours. Previous versions of zenbot would have displayed something. That said, NOT adding the "gemini.BTC-USD" selector (which defaults to gdax.BTC-USD) works fine and normally.

Source code / logs

Nothing on the screen at all nor logs. Only way to recover is control-C

defkev commented 6 years ago

Looks like their API is only returning data for the last 7 days

curl https://api.gemini.com/v1/trades/btcusd?since=1512111600
...
{
   "reason" : "HistoricalDataNotAvailable",
   "message" : "Requested date 2017-12-01T07:00:00.000Z is after the max available historical date 2017-12-23T23:00:30.284Z",
   "result" : "error"
}

So use ./zenbot.sh backfill gemini.BTC-USD -days=6 or ...7 depending on your timezone

IMHO this should be handled by the gemini-api module and the author seems to be aware of this, as the README in his repo includes a

ToDo: More robust error handling

💩

deamonkai commented 6 years ago

Wonder if that's something Gemini changed recently then. True though, the exchange.js should trap it.

defkev commented 6 years ago

Dunno, their docs don't say anything about the reason returned.

The exchange.js already handles errors causing the operation to be retried. I suppose the problem here is that there is none returned by the underlying module.