Package com.quantfinlib.backtest.portfolio
package com.quantfinlib.backtest.portfolio
Multi-asset backtesting:
PortfolioBacktester rebalances
long/short weight targets from a
PortfolioStrategy with
commission and turnover tracking (input series must be index-aligned —
see data.SeriesAligner), and in its survivorship-aware overload
consumes a data.PointInTimeUniverse (delistings terminate at the
delisting return, mergers convert at deal terms, index drops force sales)
plus explicit ex-date cash dividends;
CrossSectionalMomentum is the
built-in point-in-time factor strategy (12-1 momentum ranked over the
members alive at each rebalance);
PositionSizing supplies Kelly,
fixed-fractional risk, inverse-volatility weights and vol-target leverage.-
ClassDescriptionPoint-in-time cross-sectional momentum — the classic equity factor, built to demonstrate (and test) universe-aware backtesting: at every rebalance the strategy ranks only the stocks that are index members at that bar's timestamp, goes long the best trailing performers and short the worst.Multi-asset, long/short portfolio backtester: rebalances positions (possibly fractional and negative) toward the strategy's target weights at a configurable cadence, charging commission on traded notional.
costModel, when set, supersedes the flatcommissionRatefor every trade (rebalances and forced index-drop sales alike) — the sharedTradeCostModelseam that makes a run simultaneously survivorship-aware AND execution-aware.dividendCashCreditedandlifecycleEventsAppliedare populated by the survivorship-aware overload (zero otherwise).A multi-asset, weight-based strategy for thePortfolioBacktester.Position sizing rules: Kelly, fixed-fractional risk, inverse-volatility weighting, and volatility targeting — the building blocks forPortfolioStrategyweight construction.