Uses of Interface
com.quantfinlib.alpha.AlphaFactor
Packages that use AlphaFactor
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 AlphaFactor in com.quantfinlib.alpha
Methods in com.quantfinlib.alpha that return AlphaFactorModifier and TypeMethodDescriptionstatic AlphaFactorFactors.bollinger(int period, double stdDevs) Bollinger mean reversion:−(close − SMA) / (k·σ)— the negative band position, +1 at the lower band, −1 at the upper.static AlphaFactorFactors.lowVolatility(int lookback) Low-volatility anomaly:−σ(returns)over the lookback — calm names score high.static AlphaFactorFactors.macd(int fast, int slow, int signal) MACD histogram normalized by price:(macdLine − signalLine) / close.static AlphaFactorFactors.meanReversion(int lookback) Plain mean reversion:−(close / SMA − 1)— how far the price sits below its own average, as a fraction.static AlphaFactorFactors.momentum(int lookback, int skip) Cross-sectional momentum:close[i−skip] / close[i−lookback] − 1.static AlphaFactorFactors.movingAverageCrossover(int fast, int slow) Moving-average crossover:(SMA_fast − SMA_slow) / SMA_slow.static AlphaFactorFactors.quality()Quality composite: profitability minus leverage —ROE − 0.1 × debt/equity.static AlphaFactorFactors.rsi(int period) Contrarian RSI:(50 − RSI) / 50, in [−1, +1].static AlphaFactorFactors.value()Value composite: the average of earnings yield (1/PE) and book yield (1/PB) — yields, not ratios, so "cheap" is high and negative-earnings names contribute a negative yield rather than a meaningless negative PE rank.Methods in com.quantfinlib.alpha with parameters of type AlphaFactorModifier 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.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.Method parameters in com.quantfinlib.alpha with type arguments of type AlphaFactorModifier and TypeMethodDescriptionAlphaValidation.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.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.