OptionaldelayBars between the bar a target is decided on (at its close) and the bar it executes on. 0 needs fill_at "close".
OptionalfeeFractional fee on the traded notional, one value for all assets or one per asset.
OptionalfeeFixed fee per contract traded, one value for all assets or one per asset.
OptionalfillExecution price on the execution bar: "open", "close", "typical" ((high + low + close) / 3), or "ohlc4".
OptionalinitialStarting capital. Portfolio equity is this plus the summed pnl of all assets; weights are fractions of it.
OptionalmaxLargest gross exposure, sum of absolute position values over equity. Orders that exceed it are scaled down. The default, inf, is no cap.
OptionalmaxLargest absolute net exposure, sum of position values over equity. Orders that exceed it are scaled down. The default, inf, is no cap.
OptionalmultiplierContract multiplier per asset, applied to pnl, notional, and proportional fees.
OptionalrebalanceWhen the band trips: "drifted" trades only the assets beyond it, "all" rebalances every asset that has a target.
OptionalrebalanceTrade a held asset back to its target when its holding drifts from it by more than this fraction of equity (0 = never). Needs size "weight" or "notional".
OptionalsizeWhat a target means: "weight" (a fraction of portfolio equity), "notional" (a currency amount), or "units" (a position).
OptionalslippageAdverse price offset on every fill, read in slippage_unit, one value for all assets or one per asset.
OptionalslippageUnit of slippage: "fraction" of the reference price (5 bps = 5e-4), "ticks" of tick_size, or "price".
OptionaltickPrice grid per asset (0 = continuous). Slippage offsets round up to whole ticks.
The settings of BacktestPortfolioOHLCTarget by name, for
BacktestPortfolioOHLCTarget({ ... }).