DeviaVir / zenbot

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

cex.io backfill depth problem #1952

Closed korkin25 closed 4 years ago

korkin25 commented 4 years ago

Hi,

z@zcex:~/zenbot$ ./zenbot.sh -V 4.1.0

I dont have problems backfill with any exchange except of cex.io.

z@zcex:~/zenbot$ ./zenbot.sh backfill poloniex.BTC-USDT --days=1 (node:30320) DeprecationWarning: collection.save is deprecated. Use insertOne, insertMany, updateOne, or updateMany instead.

skipping 24 hrs of previously collected data

poloniex.BTC-USDT saved 200 trades 0 days left

download complete!

But cex.io: z@zcex:~/zenbot$ ./zenbot.sh backfill cexio.BTC-USD --days=1 (node:30580) DeprecationWarning: collection.save is deprecated. Use insertOne, insertMany, updateOne, or updateMany instead.

skipping 10457 hrs of previously collected data

cexio.BTC-USD saved 1000 trades 1473 days left

I wanted only 1 day, but you see.

Also.. that ends with following:

z@zcex:~/zenbot$ ./zenbot.sh backfill cexio.BTC-USD --days=1 (node:30580) DeprecationWarning: collection.save is deprecated. Use insertOne, insertMany, updateOne, or updateMany instead.

skipping 10457 hrs of previously collected data

cexio.BTC-USD saved 1000 trades 1473 days left . error: getTrades() returned duplicate results { product_id: 'BTC-USD', from: 376024 } { product_id: 'BTC-USD', from: 376024 }

Thank you.

james-ingold commented 4 years ago

The depth problem is just the way the Cex.io API is constructed, they don't let you specify a date range, so zenbot will get all the data it can. There's nothing that can be done about that.

The duplicate results is a bug with the Cex.io data, 375024 and 376024 return the same exact data which causes the backfill to fail.

https://cex.io/api/trade_history/BTC/USD/?since=375024 and https://cex.io/api/trade_history/BTC/USD/?since=376024

I created a pull request with a fix for this issue. https://github.com/DeviaVir/zenbot/pull/1982

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.