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.
metrics : list[str | BaseMetric | dict[str, BaseMetric]]
Ordered built-in keys, stored names, or custom metric instances to compute. The first
metric summarizes the result.
exchange : ExchangeExpConfig
Commission, slippage, order execution, margin and short-selling.
engine : EngineExpConfig
Warmup, timing and data-handling policies.
|
See Also
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. |
Convert the experiment configuration to a nested dictionary.
| Returns |
dict
Self as dict.
|
Build an ExperimentConfig from a (possibly nested) dictionary.
The dict may use the nested API structure produced by to_dict
(with general, data, portfolio, etc. keys) or
a flat key-value mapping. Missing keys silently fall back to defaults.
| Parameters |
Source dictionary.
|
| Returns |
self
The created instance.
|
Serialise the configuration to a TOML string.
The output is grouped into [general][general], [data][data],
[portfolio][portfolio], [strategy][strategy], [indicators][indicators], [metrics][metrics],
[exchange][exchange] and [engine][engine] sections.
| Returns |
str
TOML representation of the config.
|
Build an ExperimentConfig from a TOML string.
| Parameters |
TOML document.
|
| Returns |
self
The created instance.
|