OptionalfeeFixed fee (or rebate when negative) charged per contract on each fill.
OptionalinitialStarting capital for size="weight" and for rebalance_band; equity is initial_capital plus the backtest's cumulative pnl.
OptionalmaxCap each print's fill at this share of the print's size; the rest fills on later prints. The default fills the whole order on any print. inf is no cap.
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 each taker fill at the print price.
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 BacktestTradesTarget by name, for
BacktestTradesTarget({ ... }).