Class AlphaBacktester
- Commission — flat bps on traded notional;
- Bid-ask spread — half-spread bps paid on every trade (crossing the spread once per side);
- Slippage — additional fixed bps of implementation noise (latency, partial fills, venue fees);
- Market impact — the size-dependent cost, via the
square-root law in
microstructure.MarketImpactModel, with per-symbol ADV and daily vol estimated from the trailing window. This is the term that grows with capital: the same signal that nets 8% on $10m can net zero on $1b.
The simulation is weight-based (fractional book, returns
compound multiplicatively from 1.0): simpler and adequate for factor
research. For share-level accounting with lifecycle events, feed the
constructed weights into backtest.portfolio.PortfolioBacktester's
survivorship-aware overload with
Config.withCostModel(TradeCostModel.institutional(...)) — since
both engines share the same impact estimator
(MarketImpactModel.estimate) and cost decomposition, a run over
there is execution-aware AND survivorship-aware at once; this engine's
added value is the per-component cost drag breakdown.
Both gross and net curves are tracked, plus the cumulative drag of each cost component — "which cost kills this signal" is the actionable output of an execution-aware backtest.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final recordNet/gross curves plus the cumulative fraction of equity each cost component consumed — the cost autopsy.static interfaceBuilds target weights from raw scores at a rebalance (the construction hook). -
Method Summary
Modifier and TypeMethodDescriptionstatic AlphaBacktester.Resultrun(AlphaContext ctx, AlphaFactor factor, AlphaBacktester.Config config) Runs with the standard z-score construction (gross 1.0, 5% name cap).static AlphaBacktester.Resultrun(AlphaContext ctx, AlphaFactor factor, AlphaBacktester.Config config, AlphaBacktester.WeightBuilder builder) Runs with a caller-supplied construction pipeline.
-
Method Details
-
run
public static AlphaBacktester.Result run(AlphaContext ctx, AlphaFactor factor, AlphaBacktester.Config config) Runs with the standard z-score construction (gross 1.0, 5% name cap). -
run
public static AlphaBacktester.Result run(AlphaContext ctx, AlphaFactor factor, AlphaBacktester.Config config, AlphaBacktester.WeightBuilder builder) Runs with a caller-supplied construction pipeline.
-