mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-18 12:20:12 +08:00
Bug fixes and housekeeping from ingestion testing
This commit is contained in:
@@ -50,7 +50,7 @@ class Bitfinex(Exchange):
|
||||
self._portfolio = portfolio
|
||||
self.minute_writer = None
|
||||
self.minute_reader = None
|
||||
self.num_candles_limit = 1000
|
||||
self.num_candles_limit = 10000
|
||||
|
||||
# Max is 90 but playing it safe
|
||||
# https://www.bitfinex.com/posts/188
|
||||
|
||||
@@ -418,7 +418,8 @@ class Exchange:
|
||||
|
||||
return value
|
||||
|
||||
def get_history(self, assets, end_dt, bar_count, data_frequency):
|
||||
def get_history(self, assets, end_dt, bar_count, data_frequency,
|
||||
fallback_exchange=True):
|
||||
"""
|
||||
Retrieve OHLCV bars from the Catalyst and/or exchange API.
|
||||
|
||||
@@ -443,11 +444,13 @@ class Exchange:
|
||||
asset=asset,
|
||||
end=end_dt,
|
||||
bar_count=bar_count,
|
||||
data_frequency=data_frequency
|
||||
data_frequency=data_frequency,
|
||||
fallback_exchange=fallback_exchange
|
||||
)
|
||||
return candles
|
||||
|
||||
def get_asset_history(self, asset, end, bar_count, data_frequency):
|
||||
def get_asset_history(self, asset, end, bar_count, data_frequency,
|
||||
fallback_exchange=True):
|
||||
"""
|
||||
Retrieve the OHLVC bars of a single asset.
|
||||
|
||||
@@ -495,7 +498,7 @@ class Exchange:
|
||||
)
|
||||
data += candles
|
||||
|
||||
if exchange_start is not None:
|
||||
if exchange_start is not None and fallback_exchange:
|
||||
candles = self.get_candles(
|
||||
data_frequency=data_frequency,
|
||||
assets=[asset],
|
||||
|
||||
@@ -227,7 +227,8 @@ class ExchangeBundle:
|
||||
assets=[asset],
|
||||
end_dt=end_dt,
|
||||
bar_count=bar_count,
|
||||
data_frequency=data_frequency
|
||||
data_frequency=data_frequency,
|
||||
fallback_exchange=False
|
||||
)
|
||||
|
||||
num_candles = 0
|
||||
|
||||
Reference in New Issue
Block a user