Uses of Class
com.quantfinlib.alpha.AlphaContext
Packages that use AlphaContext
Package
Description
The alpha research pipeline — signal to evaluated, validated, cost-aware,
constructed, reported strategy, with each stage a separate, composable
step:
Signal generation —
Factors:
nine standard factors (MA crossover, contrarian RSI, MACD,
Bollinger reversion, mean reversion, 12-1 momentum, value, quality,
low volatility) producing raw cross-sectional scores over an
AlphaContext panel;
Evaluation — SignalEvaluator:
rank IC, IR, t-stat, hit rate, turnover, cross-factor exposure —
the cheap filter before any backtest;
Validation — AlphaValidation:
walk-forward selection with OOS efficiency, blocked k-fold
consistency, Monte Carlo permutation p-values, parameter
sensitivity — the overfitting defense;
Execution-aware backtest —
AlphaBacktester: commission, bid-ask
spread, slippage and square-root market impact
(microstructure.MarketImpactModel), with gross-vs-net cost
decomposition;
Portfolio construction —
PortfolioConstruction: z-score
sizing with caps, inverse-vol risk budgeting, sector and beta
neutralization, mean-variance tilt;
Reporting — AlphaReport:
alpha decay with half-life, OLS factor attribution, drawdown
curves, rolling Sharpe, and the shared ratio set from
backtest.PerformanceAnalytics.
-
Uses of AlphaContext in com.quantfinlib.alpha
Methods in com.quantfinlib.alpha that return AlphaContextModifier and TypeMethodDescriptionstatic AlphaContextPanel without fundamentals (technical factors only).static AlphaContextPanel with a fundamentals snapshot for value/quality factors.AlphaContext.withUniverse(PointInTimeUniverse universe) The same panel with a point-in-time universe attached: built-in factors then score non-members as NaN per bar (see the class doc).Methods in com.quantfinlib.alpha with parameters of type AlphaContextModifier and TypeMethodDescriptionAlphaValidation.crossValidate(AlphaContext ctx, AlphaFactor factor, int horizon, int startIndex, int k) Splits the evaluation range intokcontiguous blocks and recomputes the mean IC inside each.static AlphaReport.DecayAlphaReport.decayProfile(AlphaContext ctx, AlphaFactor factor, int startIndex, int[] horizons) Evaluates the factor's mean IC at each horizon.static SignalEvaluator.ReportSignalEvaluator.evaluate(AlphaContext ctx, AlphaFactor factor, int startIndex, int horizon) Evaluates a factor over[startIndex, ctx.bars() − horizon), stepping byhorizon(non-overlapping forward windows).static doubleSignalEvaluator.factorExposure(AlphaContext ctx, AlphaFactor a, AlphaFactor b, int startIndex, int step) Mean cross-sectional rank correlation between two factors' scores — how much of factor B is already inside factor A.AlphaValidation.monteCarloRobustness(AlphaContext ctx, AlphaFactor factor, int horizon, int startIndex, int trials, long seed) Permutation test on the score/return pairing: per trial, scores from datetᵢare paired with forward returns from a shuffled datetⱼ, destroying any true predictive link while preserving both marginal distributions.AlphaValidation.parameterSensitivity(AlphaContext ctx, List<AlphaFactor> sweep, int horizon, int startIndex) Evaluates each candidate (an ORDERED parameter sweep — neighbors in the list must be neighbors in parameter space) and reports the worst IC drop between adjacent candidates.SignalEvaluator.quantileReturns(AlphaContext ctx, AlphaFactor factor, int startIndex, int horizon, int quantiles) Buckets each evaluation date's cross-section intoquantilesscore-ranked groups and averages the forward returns per group, over the same non-overlapping date grid asSignalEvaluator.evaluate(AlphaContext, AlphaFactor, int, int): dates step byhorizonfromstartIndex, a NaN score or NaN forward return drops that (symbol, date) pair, and a date with fewer complete pairs thanquantilescontributes to no bucket at all.static AlphaBacktester.ResultAlphaBacktester.run(AlphaContext ctx, AlphaFactor factor, AlphaBacktester.Config config) Runs with the standard z-score construction (gross 1.0, 5% name cap).static AlphaBacktester.ResultAlphaBacktester.run(AlphaContext ctx, AlphaFactor factor, AlphaBacktester.Config config, AlphaBacktester.WeightBuilder builder) Runs with a caller-supplied construction pipeline.double[]AlphaFactor.scores(AlphaContext ctx, int index) Raw scores atindex, aligned with the context's symbols.static double[]PortfolioConstruction.sectorNeutralize(AlphaContext ctx, double[] weights, Map<String, String> sectorBySymbol) PortfolioConstruction.sectorNeutralize(double[], String[])with alignment by construction: sector labels come as a map keyed by symbol and are resolved against the context's frozen (sorted!)static double[]PortfolioConstruction.trailingBetas(AlphaContext ctx, int index, int lookback) Trailing OLS betas of each symbol against the equal-weight universe return — the in-panel market proxy when no index series is supplied.static double[]PortfolioConstruction.trailingVols(AlphaContext ctx, int index, int lookback) Trailing return volatilities per symbol atindex— the standard input toPortfolioConstruction.inverseVolBudget(double[], double[], double)(per-bar σ; the common scale cancels in the renormalization).AlphaValidation.walkForward(AlphaContext ctx, List<AlphaFactor> candidates, int horizon, int startIndex, int trainBars, int testBars) Rolls a train/test split across the sample: each fold picks the candidate with the best training-window mean IC and scores it on the nexttestBarsunseen bars.double[]AlphaBacktester.WeightBuilder.weights(AlphaContext ctx, double[] scores, int index)