Skip to content

Commit

Permalink
[Importer] handle multi exchange data files
Browse files Browse the repository at this point in the history
tmp
  • Loading branch information
techfreaque committed Mar 3, 2023
1 parent ab265fc commit 4565dcc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions octobot_backtesting/api/importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ def get_data_file(importer) -> str:
return importer.file_path


def get_data_file_from_importers(available_importers, symbol, time_frame) -> str:
def get_data_file_from_importers(
available_importers, symbol, time_frame, exchange_name=None) -> str:
for importer in available_importers:
if symbol in get_available_symbols(importer) and \
time_frame in get_available_time_frames(importer):
time_frame in get_available_time_frames(importer) and \
(not exchange_name or exchange_name == importer.exchange_name):
return get_data_file_path(importer)
return None

Expand Down
1 change: 1 addition & 0 deletions octobot_backtesting/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

CONFIG_BACKTESTING = "backtesting"
CONFIG_BACKTESTING_DATA_FILES = "files"
CONFIG_CURRENT_BOT_DATA = "current_bot_data"
CONFIG_ANALYSIS_ENABLED_OPTION = "post_analysis_enabled"
CONFIG_BACKTESTING_OTHER_MARKETS_STARTING_PORTFOLIO = 10000
BACKTESTING_DATA_OHLCV = "ohlcv"
Expand Down

0 comments on commit 4565dcc

Please sign in to comment.