Skip to content

Commit

Permalink
Registered QuandlDataProvider in the demo_ioc (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
myrmarachne authored Nov 24, 2023
1 parent 1136fe2 commit 574fdea
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions demo_scripts/demo_configuration/demo_ioc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)

Expand All @@ -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()


Expand Down

0 comments on commit 574fdea

Please sign in to comment.