nautechsystems / nautilus_trader

A high-performance algorithmic trading platform and event-driven backtester
https://nautilustrader.io
GNU Lesser General Public License v3.0
2.23k stars 506 forks source link

InstrumentProviderConfig broken in develop branch #901

Closed rsmb7z closed 1 year ago

rsmb7z commented 1 year ago

Bug Report

Expected Behavior

Import should work including InstrumentProviderConfig.

Actual Behavior

ImportableConfig is broken after method ImportableConfig added in develop branch. After the function being added it explicitly expects dict and gives hash error when InstrumentProviderConfig is added.

Steps to Reproduce the Problem

Working config in Master branch

data_clients = {
    "IB": dict(
        factory_path="nautilus_trader.adapters.interactive_brokers.factories:InteractiveBrokersLiveDataClientFactory",
        config_path="nautilus_trader.adapters.interactive_brokers.config:InteractiveBrokersDataClientConfig",
        config=dict(
            account_id=account_id,
            gateway_host=gateway_host,
            trading_mode=trading_mode,
            gateway_port=gateway_port,
            client_id=client_id,
            start_gateway=False,
            read_only_api=False,
            instrument_provider=InstrumentProviderConfig(
                load_all=Treue,
                filters={"filters": tuple([tuple(filt.items()) for filt in instrument_filters])},
            ),
        ),
    ),
}

Expected config in Develop branch [not working when instrument_provider is added]

data_clients = {
    "IB": ImportableConfig(
        factory=ImportableFactoryConfig(
            path="nautilus_trader.adapters.interactive_brokers.factories:InteractiveBrokersLiveDataClientFactory",
        ),
        path="nautilus_trader.adapters.interactive_brokers.config:InteractiveBrokersDataClientConfig",
        config=dict(
            account_id=account_id,
            gateway_host=gateway_host,
            trading_mode=trading_mode,
            gateway_port=gateway_port,
            client_id=client_id,
            start_gateway=False,
            read_only_api=False,
            instrument_provider=InstrumentProviderConfig(
                load_all=Treue,
                filters={"filters": tuple([tuple(filt.items()) for filt in instrument_filters])},
            ),
        ),
    ),
}

Specifications

rsmb7z commented 1 year ago

Something wrong as InstrumentProviderConfig is not working using InteractiveBrokersDataClientConfig as well.

rsmb7z commented 1 year ago

Fixed in PR #902.