-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Support for Bitfinex Importing (take 2) #1145
Conversation
Update bitfinex-api-node to latest
@cmroche Receiving this error when trying to import data from bitfinex
|
@streetbits You probably need to |
Worked like a charm, thanks man you're the best |
This is noticeable when grabing BCH before August.
@streetbits Could you please show me the step how you got it import? I tried but it still shows this error. Gekko can use Bitfinex exchange in watch mode. Do I need to do anything else? Thank you.
|
@PhatDoan It looks like you didn't apply the changes correctly. The exchanges/bitfinex.js file should have an update with |
Ah my bad. Thank you! |
* Fix issues with the 'since' property and add filtering to kraken getTrades * Add currency prefix hack for all applicable markets on kraken exchange
…ct in getPortfolio.
Great stuff, Though I am gettting rate limited when I run this (see below). Would you mind adding a delay between fetches? Here is the error (I logged from your monkey patched getTrades):
|
@askmike There already is a rate limiter, I set it to 2.5 seconds based on testing my local system (which admittedly is an older and slower computer). I bumped it up a second so that should fix it. |
Update bitfinex-api-node to latest
This is noticeable when grabing BCH before August.
FYI this PR now showing a lot of commits since I rebased develop onto this branch instead of merging, sorry in advance. |
Yes that seems to work fine, if someone runs into this I will just bump the timer some more. Thanks a lot :) |
Thanks a lot :) I wasn't able to merge automatically so have done it manually. It's now all in the latest develop! |
(feature) Support for importing trade data from Bitfinex
Issue #918
Bitfinex import is functional though due to the high volume nature of this exchange it should be noted that those imports can be very slow and large.
The importer uses a 2.5 second delay between requests to prevent coming up against the API rate limit. While the Bitfinex API documentation says that you can either do 60 or 90 requests per second (depending on the source in their website) in practice I'm finding it to be a little bit lower than that.
Since it is only possible to import historical data using the
v2
api, I've update the bitfinex-api-node library and made minor changes for compatibility to the initialization code. The regular exchange functions still use thev1
API asv2
is considered beta and a bit of a pain to change over.Bitfinex's new API for trades uses a time range for the import,
start
andend
must be specified for the query to work, and results are limited to a max of 1000 per query. However if the time range exceeds the record limit the API will return results from theend
point first heading towardsstart
, that is will return more recent trades first. Because of this approach it is necessary to do the import by iterating backwards, however since this doesn't work with many modules the system will substep by breaking the import into sequential time ranges, then reverse iterate to fill them before sending to the dispatcher.