BLD: fetching trades recursively

This commit is contained in:
Frederic Fortier
2018-03-10 21:37:31 -05:00
parent 8bf639b01a
commit 437e5c5b80
2 changed files with 8 additions and 5 deletions
+5 -5
View File
@@ -257,10 +257,10 @@ class Exchange:
elif data_frequency is not None:
applies = (
(
data_frequency == 'minute' and
a.end_minute is not None)
or (
data_frequency == 'daily' and a.end_daily is not None)
data_frequency == 'minute' and a.end_minute is not None
) or (
data_frequency == 'daily' and a.end_daily is not None
)
)
else:
@@ -606,7 +606,7 @@ class Exchange:
start_dt = get_start_dt(end_dt, adj_bar_count, data_frequency)
trailing_dt = \
series[asset].index[-1] + get_delta(1, data_frequency) \
if asset in series else start_dt
if asset in series else start_dt
# The get_history method supports multiple asset
# Use the original frequency to let each api optimize
+3
View File
@@ -17,6 +17,9 @@ def get_exchange(exchange_name, base_currency=None, must_authenticate=False,
skip_init=False, auth_alias=None, config=None):
key = (exchange_name, base_currency)
if key in exchange_cache:
if not skip_init:
exchange_cache[key].init()
return exchange_cache[key]
exchange_auth = get_exchange_auth(exchange_name, alias=auth_alias)