Uses of Package
com.quantfinlib.core

Packages that use com.quantfinlib.core
Package
Description
The alpha research pipeline — signal to evaluated, validated, cost-aware, constructed, reported strategy, with each stage a separate, composable step: Signal generationFactors: 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; EvaluationSignalEvaluator: rank IC, IR, t-stat, hit rate, turnover, cross-factor exposure — the cheap filter before any backtest; ValidationAlphaValidation: walk-forward selection with OOS efficiency, blocked k-fold consistency, Monte Carlo permutation p-values, parameter sensitivity — the overfitting defense; Execution-aware backtestAlphaBacktester: commission, bid-ask spread, slippage and square-root market impact (microstructure.MarketImpactModel), with gross-vs-net cost decomposition; Portfolio constructionPortfolioConstruction: z-score sizing with caps, inverse-vol risk budgeting, sector and beta neutralization, mean-variance tilt; ReportingAlphaReport: alpha decay with half-life, OLS factor attribution, drawdown curves, rolling Sharpe, and the shared ratio set from backtest.PerformanceAnalytics.
Bar-based backtesting.
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.
Built-in TradingStrategy implementations: SMA/EMA crossovers, RSI mean reversion, MACD signal-line cross, and Bollinger band reversion.
The defense against overfit backtests: ParameterGrid + GridSearchOptimizer enumerate and rank parameter combinations; WalkForwardAnalyzer optimizes on rolling train windows and evaluates on unseen test windows, stitching out-of-sample equity (capital carries across folds) and reporting the walk-forward efficiency ratio; SharpeValidation applies the Bailey/López de Prado probabilistic and deflated Sharpe — the multiple-testing haircut for grid-picked winners — plus the minimum track record length (how many periods before the record MEANS something, in closed form); BlockBootstrap hands the backtest Sharpe its sampling DISTRIBUTION (stationary Politis-Romano blocks — an iid resample destroys the autocorrelation and understates the uncertainty, the classic route to false confidence): the honest question is whether the 5th percentile is still positive, not whether 1.2 is a good number.
Core market data types: Bar (immutable OHLCV bar) and BarSeries (cache-friendly structure-of-arrays time series with zero-copy array accessors, returns, and train/test slicing).
Data in, out, and preparation — the bridge between real-world files/feeds and the analytics stack: CsvBarLoader (RFC-4180-tolerant CSV bars), HttpBarFetcher (CSV over HTTP), TickFileWriter/TickFileReader (QFLT binary tick format with as-fast-as-possible or paced replay), TickCapture (record the live bus for deterministic replay), SeriesAligner (timestamp intersection / union+forward-fill for ragged multi-asset data) CorporateActions (split/dividend back-adjustment) and PointInTimeUniverse (as-of membership + delisting/merger terminal events — the engine half of survivorship-bias-free backtesting, consumed by the universe-aware PortfolioBacktester overload and StockScreener.membersAsOf) with UniverseCsvLoader as its documented CSV interchange format for user-supplied membership/lifecycle data.
Strategy Builder DSL: compose Rules (built via Rules factories over indicator arrays, with and/or/not combinators) into a backtestable strategy through StrategyBuilder — entry/exit rules, stop loss and take profit in a fluent chain.
Runnable demonstrations and benchmarks (excluded from coverage — they are run manually or by the Benchmarks (Linux) workflow): QuickStartDemo tours every capability on synthetic data; HftLatencyBenchmark measures the market data hot path and HftOrderBenchmark the order path (both print a HiccupMonitor summary to attribute tail outliers to platform stalls).
Technical analysis engine: Indicators (21 batch indicators over primitive arrays, NaN warm-ups) and StreamingIndicators (O(1)-per-tick incremental versions for live/HFT strategies).
Market data transport, two lanes:
Market microstructure analytics: MarketImpactModel (square-root law + Almgren-Chriss temporary/permanent decomposition), AlmgrenChriss (closed-form optimal execution trajectories on the cost/risk frontier), QueueModel (fill probability from queue position and latency advantage), TransactionCostAnalyzer (implementation shortfall, slippage vs VWAP, effective spread per fill), TickSizeSchedule (banded price grids) and Auction (call uncross).
Professional report generation, all writers hand-rolled on the JDK: ReportGenerator assembles portfolio, performance, risk, allocation, trade, Monte Carlo and technical sections into a Report, exported as HTML (with inline SvgCharts equity/drawdown charts), CSV, PDF, or XLSX.
Stock screening: StockScreener applies composable ScreenFilters — TechnicalFilters (RSI, moving averages, MACD, ADX, VWAP, SuperTrend, Bollinger, Ichimoku, breakouts, volume spikes, gaps, 52-week levels) and FundamentalFilters (market cap, P/E, P/B, EPS, ROE, dividend yield, leverage) — then ranks survivors with the weighted min-max RankingEngine and exports to CSV.
Volatility models: EwmaVolatility (RiskMetrics exponentially-weighted variance, λ = 0.94), Garch11 (Gaussian MLE with variance targeting; conditional variances and mean-reverting k-step forecasts) and GjrGarch11 (the leverage-effect asymmetry equity indices demand — a down move raises tomorrow's variance by α + γ, an up move by only α; fitting γ ≈ 0 is itself the finding that the series is symmetric), Egarch11 (Nelson's log-variance dynamics: leverage as a SIGN — γ < 0 — with no positivity constraints by construction; one-step forecasts exact, multi-step deliberately refused since the log recursion forecasts the median, not the mean), and HarRv (Corsi's heterogeneous autoregressive realized-vol model — daily/weekly/monthly horizons by plain OLS, the forecasting benchmark GARCH papers have to beat; pair it with microstructure.JumpRobustVolatility's bipower variance to keep jumps out of the forecast).