Configuration Reference¶
This is the authoritative configuration reference mapped to the current codebase. It covers both config formats:
- C++ Engine Config used by
YamlConfigLoaderandEngineFactory. - Python BacktestConfig used by
python/bindings.cppandregimeflow.cli.
C++ Engine Config¶
Engine¶
engine.initial_capitaldouble.engine.currencystring.engine.audit_log_pathstring.
Plugins¶
plugins.search_pathsarray of plugin directories.plugins.loadarray of plugin filenames or paths.
Data¶
data.typeselects the data source.- All other keys are passed to
DataSourceFactory.
See guide/data-sources.md for per-type fields.
Symbols And Range¶
symbolsarray of symbol strings.start_dateandend_dateasYYYY-MM-DD.bar_typesuch as1d,1h,5m.
Strategy¶
strategy.nameorstrategy.typebuilt-in or plugin name.strategy.paramsmap of strategy parameters.
Regime¶
regime.detectororregime.type.regime.paramsfor plugin detectors.regime.hmm.*for HMM configuration.regime.ensemble.*for ensemble configuration.
See guide/regime-detection.md.
Execution¶
execution.modelorexecution.type.execution.slippage.*.execution.commission.*.execution.transaction_cost.*.execution.market_impact.*.execution.latency.ms.execution.simulation.bar_modeforclose_only,open_only, orintrabar_ohlc.execution.simulation.tick_modeforsynthetic_ticksorreal_ticks.execution.simulation.synthetic_tick_profileforbar_close,bar_open, orohlc_4tick.execution.session.enabled,execution.session.start_hhmm,execution.session.end_hhmm.execution.session.open_auction_minutes,execution.session.close_auction_minutes.execution.session.weekdaysto restrict execution to specific UTC weekdays (sun..sator0..6).execution.session.closed_datesforYYYY-MM-DDmarket closures.execution.session.haltfor a global execution halt.execution.session.halted_symbolsarray for symbol-specific halts.execution.policy.fill,execution.policy.max_deviation_bps,execution.policy.price_drift_action.execution.queue.enabled,execution.queue.progress_fraction,execution.queue.default_visible_qty,execution.queue.depth_mode.execution.queue.aging_fractionto model cancellations ahead while the market moves away.execution.queue.replenishment_fractionto model new queue rebuilding ahead when visible size increases.execution.routing.*for smart routing controls.execution.routing.venues[]may also includemaker_rebate_bps,taker_fee_bps,price_adjustment_bps,latency_ms,queue_enabled,queue_progress_fraction,queue_default_visible_qty, andqueue_depth_modefor venue-specific routed child behavior.execution.account.margin.initial_margin_ratio,execution.account.margin.maintenance_margin_ratio,execution.account.margin.stop_out_margin_level.execution.margin.*is also accepted as a shorthand when you are constructing the execution config block directly.execution.account.enforcement.enabled.execution.account.enforcement.margin_call_actionforignore,cancel_open_orders, orhalt_trading.execution.account.enforcement.stop_out_actionfornone,liquidate_all, orliquidate_worst_first.execution.account.enforcement.halt_after_stop_out.execution.account.financing.enabled.execution.account.financing.long_rate_bps_per_day.execution.account.financing.short_borrow_bps_per_day.execution.enforcement.*andexecution.financing.*are also accepted as shorthand when you are constructing the execution config block directly.
See guide/execution-models.md.
Risk¶
risk.limits.*for standard limits.risk.limits_by_regime.*for regime-specific limits.risk.stop_loss.*,risk.trailing_stop.*,risk.atr_stop.*,risk.time_stop.*.
See guide/risk-management.md.
Live¶
live.broker,live.paper,live.symbols.live.reconnect.*,live.heartbeat.*.live.riskblock.live.broker_configmap.live.log_dirfor output paths.live.broker_asset_classfor broker TIF support (equity,crypto).live.routing.*for live smart routing controls.live.execution.routing.*is also accepted so live configs can mirror the backtestexecution.routing.*layout.live.account.margin.*for internal portfolio margin tracking in the live dashboard snapshot.account.margin.*can be shared across backtest and live, then overridden bylive.account.margin.*.
Live Metrics¶
metrics.live.enableboolean.metrics.live.baseline_reportpath to backtest report JSON.metrics.live.output_dirdirectory forlive_drift.csvandlive_performance.json.metrics.live.sinksarray, supportsfileandpostgres.metrics.live.postgres.connection_string.metrics.live.postgres.table.metrics.live.postgres.pool_size.
See live/config.md.
Python BacktestConfig¶
Python config keys map to BacktestConfig in python/bindings.cpp:
data_sourcestring.dataobject (data source config).symbolslist.start_date,end_date,bar_type.initial_capital,currency.regime_detector,regime_params.plugins_search_paths,plugins_loadorplugins.search_paths,plugins.load.execution_model,execution_params.slippage_model,slippage_params.commission_model,commission_params.risk_params.strategy_params.
Python Example¶
data_source: csv
data:
data_directory: examples/backtest_basic/data
file_pattern: "{symbol}.csv"
has_header: true
symbols: ["AAPL", "MSFT"]
start_date: "2019-01-01"
end_date: "2020-12-31"
bar_type: "1d"
initial_capital: 100000.0
currency: "USD"
regime_detector: hmm
regime_params:
hmm:
states: 4
window: 20
slippage_model: fixed_bps
slippage_params:
bps: 1.0
commission_model: fixed
commission_params:
amount: 0.005
execution_params:
simulation:
tick_mode: real_ticks
synthetic_tick_profile: ohlc_4tick
bar_mode: intrabar_ohlc
session:
enabled: true
start_hhmm: "09:30"
end_hhmm: "16:00"
open_auction_minutes: 1
close_auction_minutes: 1
halted_symbols: ["AAPL"]
transaction_cost:
type: maker_taker
maker_rebate_bps: 1
taker_fee_bps: 2
policy:
fill: return
max_deviation_bps: 25
price_drift_action: requote
queue:
enabled: true
progress_fraction: 0.5
default_visible_qty: 10
depth_mode: full_depth
aging_fraction: 0.25
replenishment_fraction: 0.5
account:
margin:
initial_margin_ratio: 0.5
maintenance_margin_ratio: 0.25
stop_out_margin_level: 0.4
enforcement:
enabled: true
margin_call_action: halt_trading
stop_out_action: liquidate_worst_first
halt_after_stop_out: true
financing:
enabled: true
long_rate_bps_per_day: 5
short_borrow_bps_per_day: 12
risk_params:
limits:
max_notional: 100000
max_position_pct: 0.2
strategy_params:
fast_period: 10
slow_period: 30
quantity: 5
Validation Configuration¶
Validation keys are under validation.* for any data source config. See reference/data-validation.md for details.