Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
realiti4 committed Apr 22, 2021
1 parent f3397c6 commit ee4a609
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ You can use `.get()`, `.get_history()` and `.update()` with all avaliable apis.
* `bitmex.funding`
* `bitmex.quote`

Supported symbols: `btcusd`, `ethusd`, `ltcusd`. These are guaranteed to work with every module. You can stil use any symbol that an exchange supports. But same pair is different for each exchange of course. Using an unsupported symbold will give you a warning, but it should work just fine as long as you are using a correct symbol for that api.
Supported symbols: `btcusd`, `ethusd`, `ltcusd`. These are guaranteed to work with every module. You can stil use any symbol that an exchange supports. But same pair is different for each exchange of course. Using an unsupported symbol will give you a warning, but it should work just fine as long as you are using a correct symbol for that api.


### Get history with .get()
Expand All @@ -39,7 +39,9 @@ Supported symbols: `btcusd`, `ethusd`, `ltcusd`. These are guaranteed to work wi

df2 = bitfinex.get(2000, symbol='ethusd') # Default is btcusd, you can pass others in symbol parameter

Just pass how much data you want. It will return the amount in most recent 1h data. Currently only 1h data is supported. If history amount is above api limit, `.get()` will run `.get_history()` under the hood, so you don't need to worry about it. But if you want everything and don't want to guess how much data avaliable on each exchange, just run `.get_history()` and get everything.
df3 = bitfinex.get(20000, interval='1m') # You can pass any interval that exchange api supports

Just pass how much data you want. It will return the amount in most recent 1h data. If history amount is above api limit, `.get()` will run `.get_history()` under the hood, so you don't need to worry about it. But if you want everything avaliable on an exchange, just run `.get_history()`.

### Download all available history with .get_history()
The tool will download all avaliable history while respecting request per minute limits. Using it easy, and it takes couple of minutes for 1h data.
Expand All @@ -59,6 +61,6 @@ The tool will download all avaliable history while respecting request per minute

bitstamp = bitstamp()

bitstamp.update_csv('bitstamp.csv')
bitstamp.update('bitstamp.csv')

Update takes a path variable to csv file and updates it.
2 changes: 1 addition & 1 deletion tradingfeatures/api_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ def calc_start(self, limit, start=None, end=None, interval=3600, scale=1):
interval = self.interval_check(interval)[0]

limit = self.limit if limit is None else limit
limit = int(limit / scale) # for 8h funding, bad solution
limit = int(limit / scale) # for 8h funding scaling
end = current_time if end is None else end
if start is None:
start = end - (interval * (limit-1)) # limit -1 to be sure to get the latest hour
Expand Down
2 changes: 1 addition & 1 deletion tradingfeatures/uber.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def eval_get(self, limit=1000, **kwargs):
with ThreadPoolExecutor(8) as executor:
for api in self.apis:
api_columns = self.column_kwargs[api.name] if api.name in self.column_kwargs else None
future = executor.submit(api.get, limit=limit, columns=api_columns)
future = executor.submit(api.get, limit=limit, columns=api_columns, **kwargs)
futures.append([api.name, future])

datasets = [[item[0], item[1].result()[-limit:]] for item in futures]
Expand Down

0 comments on commit ee4a609

Please sign in to comment.