Skip to content

Commit b46eb68

Browse files
committed
Add extra debugging for market data sources
1 parent 8e8d5f5 commit b46eb68

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

investing_algorithm_framework/services/market_data_source_service/backtest_market_data_source_service.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,11 @@ def get_ticker(self, symbol, market=None):
190190
return ticker_data
191191

192192
if ticker_market_data_source is None:
193+
identifiers = self.get_market_data_source_identifiers()
193194
raise OperationalException(
194-
f"Backtest ticker data source "
195-
f"not found for {symbol} and market {market}"
195+
"Backtest ticker data source "
196+
f"not found for {symbol} and market {market}, the available "
197+
f"data sources are: {identifiers}"
196198
)
197199

198200
config = self._configuration_service.get_config()

investing_algorithm_framework/services/market_data_source_service/market_data_source_service.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,3 +362,16 @@ def get_market_data_sources(self):
362362

363363
def has_ticker_market_data_source(self, symbol, market=None):
364364
return self.get_ticker_market_data_source(symbol, market) is not None
365+
366+
def get_market_data_source_identifiers(self):
367+
"""
368+
Function to get all list of all market data source identifiers.
369+
370+
Returns:
371+
List[str]: A list of identifiers for all market data sources.
372+
"""
373+
374+
return [
375+
market_data_source.get_identifier() for market_data_source
376+
in self._market_data_sources
377+
]

0 commit comments

Comments
 (0)