diff --git a/demo_scripts/demo_configuration/demo_ioc.py b/demo_scripts/demo_configuration/demo_ioc.py index f54d3396..8e48fd7f 100644 --- a/demo_scripts/demo_configuration/demo_ioc.py +++ b/demo_scripts/demo_configuration/demo_ioc.py @@ -26,6 +26,7 @@ def _get_ioc_container(): from dic.scope import SingleInstance from qf_lib.backtesting.trading_session.backtest_trading_session_builder import BacktestTradingSessionBuilder + from qf_lib.data_providers.quandl.quandl_data_provider import QuandlDataProvider from qf_lib.common.risk_parity_boxes.risk_parity_boxes import RiskParityBoxesFactory from qf_lib.common.utils.dateutils.timer import RealTimer from qf_lib.common.utils.dateutils.timer import Timer @@ -38,6 +39,16 @@ def _get_ioc_container(): builder = ContainerBuilder() + # OTHER + settings_dir_path = join(dirname(abspath(__file__)), 'config_files') + settings_path = join(settings_dir_path, 'demo_settings.json') + secret_path = join(settings_dir_path, 'demo_secret_settings.json') + settings = Settings(settings_path, secret_path) + + builder.register_instance(Settings, settings) + + builder.register_class(QuandlDataProvider, component_scope=SingleInstance) + # PUBLISHERS builder.register_class(EmailPublisher, component_scope=SingleInstance) @@ -52,13 +63,6 @@ def _get_ioc_container(): builder.register_class(HTMLExporter, component_scope=SingleInstance) builder.register_class(RealTimer, component_scope=SingleInstance, register_as=Timer) - # OTHER - settings_dir_path = join(dirname(abspath(__file__)), 'config_files') - settings_path = join(settings_dir_path, 'demo_settings.json') - secret_path = join(settings_dir_path, 'demo_secret_settings.json') - settings = Settings(settings_path, secret_path) - builder.register_instance(Settings, settings) - return builder.build()