OptionaldelayBars between the decision and the execution. A target from bar t trades on bar t + delay. 0 is allowed only with fill_at="close" (market-on-close of the signal bar).
OptionalfeeFixed fee (or rebate when negative) charged per contract on each fill.
OptionalfillReference price of the execution bar: "open", "close", "typical" (high + low + close) / 3, or "ohlc4" (open + high + low + close) / 4.
OptionalinitialStarting capital for size="weight" and for rebalance_band; equity is initial_capital plus the backtest's cumulative pnl.
OptionalmaxThe most an order may trade on one bar, as a share of the bar's volume (0.1 = 10%). The rest carries to the next bars.
OptionalmaxUpper bound on the position, in units. It applies after size has converted the target to units, so a weight target of 2 with max_position=0.5 holds 0.5 units. The default, inf, is no bound.
OptionalminLower bound on the position, in units. It applies after size has converted the target to units, so a weight target of -2 with min_position=-0.5 holds -0.5 units. The default, -inf, is no bound.
OptionalmultiplierContract multiplier applied to mark-to-market PnL, fill slippage, and proportional fees.
OptionalrebalanceWith size="notional" or "weight", recompute the units when the holding drifts from the target by more than this fraction of equity (0.05 = 5 points of weight). 0 keeps the units until the target value changes.
OptionalsizeHow to read the target: "units" (a position), "notional" (a currency amount), or "weight" (a fraction of initial_capital + equity). It is converted to units at the execution price.
OptionalslippageAdverse price offset on every taker (market) fill, read in slippage_unit. A buy fills higher and a sell lower; resting limit fills never slip.
OptionalslippageUnit of slippage: "fraction" of the reference price (5 bps = 5e-4), "ticks" of tick_size, or "price" (an absolute amount).
OptionalstopExit when the price moves this fraction against the average entry fill (0.05 = 5%). 0 turns it off.
OptionaltakeExit when the price moves this fraction in favor of the average entry fill. 0 turns it off.
OptionaltakerFractional fee charged on a market (taker) fill at the open.
OptionaltickInstrument price grid (0 = continuous). Slippage offsets round up to whole ticks; the "ticks" slippage unit counts in this step.
OptionaltrailingExit when the price falls this fraction from the best price since entry (the highest for a long, the lowest for a short). 0 turns it off.
The settings of BacktestOHLCVTarget by name, for
BacktestOHLCVTarget({ ... }).