Skip to content

ExperimentConfig


dataclass backtide.backtest.ExperimentConfig

Complete configuration for a single backtest experiment.

Enum-valued settings accept both their enum variant and plain strings.

Attributes

general : GeneralExpConfig

Experiment name, tags and description.

data : DataExpConfig
Instrument type, symbols, date range and interval.

portfolio : PortfolioExpConfig
Initial cash, base currency and starting positions.

strategy : StrategyExpConfig
Strategies and benchmark to use in this experiment.

indicators : IndicatorExpConfig
Indicators to use in this experiment.

exchange : ExchangeExpConfig
Commission, slippage, order execution, margin and short-selling.

engine : EngineExpConfig
Warmup, timing and data-handling policies.


See Also

DataExpConfig

Data settings for an experiment.

GeneralExpConfig

General metadata for an experiment.

StrategyExpConfig

Strategy settings for an experiment.


Methods

to_dict Convert the experiment configuration to a nested dictionary.
from_dict Build an `ExperimentConfig` from a (possibly nested) dictionary.
to_toml Serialise the configuration to a TOML string.
from_toml Build an `ExperimentConfig` from a TOML string.


method backtide.backtestto_dict()

Convert the experiment configuration to a nested dictionary.

Returns

dict

Self as dict.



method backtide.backtestfrom_dict(data)

Build an ExperimentConfig from a (possibly nested) dictionary.

The dict may use the same nested structure produced by to_toml (with general, data, portfolio, etc. sections) or a flat key-value mapping. Missing keys silently fall back to defaults.

Parameters

data : dict

Source dictionary.

Returns

self

The created instance.



method backtide.backtestto_toml()

Serialise the configuration to a TOML string.

The output is grouped into [general][general], [data][data], [portfolio][portfolio], [strategy][strategy], [indicators][indicators], [exchange][exchange] and [engine][engine] sections.

Returns

str

TOML representation of the config.



method backtide.backtestfrom_toml(text)

Build an ExperimentConfig from a TOML string.

Parameters

text : str

TOML document.

Returns

self

The created instance.