Skip to content

set_config


function backtide.config.set_config(config)

Set the global configuration.

The configuration can only be set before it's used anywhere, so call this function at the start of the process. If the configuration is already used by any backtide functionality, an exception is raised. Read more in the user guide.

Parameters

config: Config

Configuration to set.


See Also

get_config

Get a copy of the current global configuration.

load_config

Load a backtide configuration from a file.


Example

>>> from backtide.config import get_config, set_config

>>> # Load the current configuration and change a value
>>> cfg = get_config()
>>> cfg.general.base_currency = "USD"

>>> # Update backtide's configuration
>>> set_config(cfg)  

>>> cfg = get_config()
>>> print(cfg.general.base_currency)

USD