Refreshing pair of only selected ticker_interval
This commit is contained in:
@@ -48,7 +48,7 @@ def load_data(datadir: str, ticker_interval: int, pairs: Optional[List[str]] = N
|
||||
# If the user force the refresh of pairs
|
||||
if refresh_pairs:
|
||||
logger.info('Download data for all pairs and store them in %s', datadir)
|
||||
download_pairs(datadir, _pairs)
|
||||
download_pairs(datadir, _pairs, ticker_interval)
|
||||
|
||||
for pair in _pairs:
|
||||
pairdata = load_tickerdata_file(datadir, pair, ticker_interval)
|
||||
@@ -73,16 +73,15 @@ def make_testdata_path(datadir: str) -> str:
|
||||
'..', 'tests', 'testdata'))
|
||||
|
||||
|
||||
def download_pairs(datadir, pairs: List[str]) -> bool:
|
||||
"""For each pairs passed in parameters, download 1 and 5 ticker intervals"""
|
||||
def download_pairs(datadir, pairs: List[str], ticker_interval: int) -> bool:
|
||||
"""For each pairs passed in parameters, download the ticker intervals"""
|
||||
for pair in pairs:
|
||||
try:
|
||||
for interval in [1, 5, 30, 60, 1440]:
|
||||
download_backtesting_testdata(datadir, pair=pair, interval=interval)
|
||||
download_backtesting_testdata(datadir, pair=pair, interval=ticker_interval)
|
||||
except BaseException:
|
||||
logger.info('Failed to download the pair: "{pair}", Interval: {interval} min'.format(
|
||||
pair=pair,
|
||||
interval=interval,
|
||||
interval=ticker_interval,
|
||||
))
|
||||
return False
|
||||
return True
|
||||
|
Reference in New Issue
Block a user