@@ -426,6 +426,7 @@ def run(self, payload: dict = None, number_of_iterations: int = None):
426
426
Returns:
427
427
None
428
428
"""
429
+ strategy_orchestrator_service = None # Predefine to avoid UnboundLocalError
429
430
430
431
try :
431
432
configuration_service = self .container .configuration_service ()
@@ -466,6 +467,8 @@ def run(self, payload: dict = None, number_of_iterations: int = None):
466
467
data_sources = self ._market_data_sources ,
467
468
on_strategy_run_hooks = self ._on_strategy_run_hooks ,
468
469
)
470
+ self .initialize_data_sources (algorithm )
471
+
469
472
strategy_orchestrator_service = \
470
473
self .container .strategy_orchestrator_service ()
471
474
strategy_orchestrator_service .initialize (algorithm )
@@ -1154,6 +1157,8 @@ def add_strategy(self, strategy, throw_exception=True) -> None:
1154
1157
None
1155
1158
"""
1156
1159
1160
+ logger .info ("Adding strategy" )
1161
+
1157
1162
if inspect .isclass (strategy ):
1158
1163
1159
1164
if not issubclass (strategy , TradingStrategy ):
@@ -1187,6 +1192,7 @@ def add_strategy(self, strategy, throw_exception=True) -> None:
1187
1192
)
1188
1193
1189
1194
if strategy .market_data_sources is not None :
1195
+ logger .info ("Adding market data sources from strategy" )
1190
1196
self .add_data_sources (strategy .market_data_sources )
1191
1197
1192
1198
self ._strategies .append (strategy )
0 commit comments