Skip to content

Commit 66809e3

Browse files
author
DUYN
committed
Add initial setup for load tickers
1 parent 62d7a12 commit 66809e3

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

bot/bot.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,28 @@ def __init__(self, config: Dict[str, Any]) -> None:
1818
self.__config = config
1919
self.__data_provider_manager = DataProviderManager(self.config)
2020

21+
# Load tickers
22+
self._load_tickers()
23+
2124
@property
2225
def config(self) -> Dict[str, Any]:
2326
return self.__config
2427

2528
def set_config(self, config: Dict[str, Any]):
2629
self.__config = config
2730

31+
def _load_tickers(self):
32+
logger.info("Initializing provided tickers from config ...")
33+
tickers = self.__config.get('tickers', [])
34+
35+
for ticker in tickers:
36+
37+
try:
38+
self.add_ticker(ticker)
39+
except OperationalException as e:
40+
logger.error(str(e))
41+
continue
42+
2843
def add_ticker(self, ticker: str) -> None:
2944
logger.info("Adding ticker ...")
3045

0 commit comments

Comments
 (0)