pub struct BacktestConfig {
pub initial_balance: f64,
pub close_on_finish: bool,
pub fill_model: FillModel,
pub contract_sizes: HashMap<String, f64>,
pub sizing: Option<SizingPolicy>,
pub symbol_specs: HashMap<String, SymbolSpec>,
pub instrument_manifest: Option<ReplayInstrumentManifest>,
}Expand description
Configuration for a backtest run.
Fields§
§initial_balance: f64Starting account balance.
close_on_finish: boolIf true, all remaining open positions are closed at market when the
data feed is exhausted.
fill_model: FillModelHow fill conditions and rule triggers interpret price quotes.
Defaults to FillModel::BidAsk — the most realistic model that
uses the appropriate side of the spread for each operation.
contract_sizes: HashMap<String, f64>Per-symbol contract size (point value) for P&L calculation.
Maps symbol name → contract size. For forex, this is typically
lot_base_units from SymbolSpec (e.g. 100_000 for majors).
For gold (XAUUSD) it’s 100 (1 lot = 100 oz).
When a symbol is absent from this map the multiplier defaults to 1.0,
which preserves backward compatibility with all existing tests.
sizing: Option<SizingPolicy>Optional position sizing policy. When set, entry signal sizes are recalculated after profile transformation using symbol metadata.
symbol_specs: HashMap<String, SymbolSpec>Symbol specs for sizing calculations. Populated by the server from the symbol registry. Empty when no sizing policy is configured.
instrument_manifest: Option<ReplayInstrumentManifest>Optional explicit instrument specifications and stored-series bindings pinned for this run.
Trait Implementations§
Source§impl Clone for BacktestConfig
impl Clone for BacktestConfig
Source§fn clone(&self) -> BacktestConfig
fn clone(&self) -> BacktestConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more