ta4j gives you the building blocks for technical-analysis-driven systems in Java: bar series, indicators, rules, strategies, reports, and a unified trading-record model that now spans backtests, paper trading, and live execution.
The current wiki reflects ta4j's newer unified trading stack:
BaseTradingRecordis the default trading-record implementation for both backtests and live or paper-trading flows.BarSeriesManageris the default single-strategy backtest driver and now accepts either its own default record factory or a record you provide.BacktestExecutorbuilds onBarSeriesManagerwhen you want to rank or tune many strategies at once, including weighted normalized leaderboards.- Manual loops are still the right tool when orders and fills are decoupled, partial fills matter, or your broker confirms executions asynchronously.
LiveTradingRecordandExecutionFillremain available only as 0.22.x compatibility facades. New code should useBaseTradingRecordandTradeFill.
- Production users and integrators should start in Start Here, then follow Canonical User Journey.
- Maintainers and design contributors should use architecture and delivery artifacts under
architecture/andcompleted-features/README.md, which are not part of the primary user onboarding path.
- Configurable backtest execution models:
BarSeriesManagerandBacktestExecutorcan now stay on the default next-open model or switch to current-close, slippage, or stop-limit execution. - Weighted strategy ranking:
BacktestExecutionResult#getTopStrategiesWeighted(...)andWeightedCriterionlet you rank strategies by a normalized composite score instead of a single raw metric. - One trade-record story for partial fills: New code can stream
TradeFillvalues directly withTradingRecord.operate(fill)or group an order withTrade.fromFills(...), then inspectgetCurrentPosition()andgetOpenPositions()on the same record. - Broader analysis surface: Recent current-master additions include
SharpeRatioCriterion,SortinoRatioCriterion,CalmarRatioCriterion,OmegaRatioCriterion, and volume pressure indicators such asForceIndexIndicator,EaseOfMovementIndicator, andKlingerVolumeOscillatorIndicator. - Forecast foundation targeting 0.23.1: Num-only summaries now declare empirical or analytic support, return estimators compose canonical
ReturnMoments, and feature vectors publish representation-bound schemas. - Exact and explicit price models:
MonteCarloPriceForecastIndicatorsummarizes transformed terminal-price paths exactly;LognormalApproximationPriceForecastIndicatoris the clearly named analytic alternative when paths are unavailable. - State-conditioned projections and calibrated tails:
AnalogReturnProjectionIndicatorbuilds deterministic empirical neighbor forecasts, andRollingConformalForecastProjectionIndicatorwidens tails from matured residuals without changing base provenance. - Composable rough-volatility state:
RoughVolatilityForecastStateIndicatorkeeps canonical return moments while adding bounded roughness, vol-of-vol, cumulative horizon variance, and an explicit analog feature schema. - Bayesian regime state:
OnlineChangePointForecastStateIndicatoradds canonical constant-hazard run-length inference, window-qualified recent-change posterior mass, typed component summaries, and direct analog composition. - Serialization named shorthand preview: The companion ta4j PR #1507 targets 0.23.1 with compact expressions such as
SMA(7,21),SmaCrossUp(7,21),RSI(14), andSharpeRatiowhile keeping canonical descriptor JSON as the durable storage format. - Forecast migration required: The 0.23.1 correction intentionally replaces the forecast API introduced in 0.23.0. See Migration and Version Compatibility.
- Primary onboarding lane: Getting Started -> Usage Examples -> Backtesting -> Live Trading -> Live Trading Runbook -> Troubleshooting Hub
- Getting Started - Install ta4j, build a strategy, and pick the right driver
- Canonical User Journey - Follow the end-to-end production path from data ingestion to live operations
- Backtesting -
BarSeriesManager,BacktestExecutor, supplied records, and manual simulation loops - Live Trading - Event-driven live or paper flows with
BaseTradingRecord - Usage Examples - Runnable examples, including parity and bot loops
- Serialization and Named Shorthand - Preview guide for ta4j PR #1507 strategy, rule, indicator, and criterion serialization
- Execution Decision Matrix - Choose execution and simulation path by workload
- Migration and Version Compatibility - Preferred APIs and incremental migration guidance
- Release Notes - Version-by-version changelog and migration notes
- Bar Series & Bars - OHLCV data, aggregation, moving windows, and streaming updates
- Data Sources - Loading bars or trades from files and HTTP providers
- Num - Precision-aware numeric types such as
DoubleNumandDecimalNum - Technical Indicators - Indicator composition and caching
- Highs and Lows - Recent swing methods, canonical defaults, confirmation timing, and forming extremes
- Forecast Indicators - Forward-looking return and price distributions, point projections, and strategy filters
- Forecast State Estimation - Minimal lifecycle state, canonical, rough-volatility, and Bayesian regime moments, representation-bound schemas, and provenance-aware summaries
- Forecast Projection Models - Analog neighbors, rolling conformal calibration, maturity guards, tuning, and failure behavior
- Trading Strategies - Rules, strategies, unstable bars, and serialization
- Serialization and Named Shorthand - Preview guide for canonical JSON, compact strategy JSON v2, and named asset expressions
- Charting - Visual overlays, trading-record rendering, and analysis charts
Use the canonical matrix for execution choices:
- Execution Decision Matrix for driver and simulation-path selection
- Backtesting for implementation patterns once you choose a backtest path
- Live Trading for fill-driven and event-driven live loops
- Analysis Criteria and Risk Metrics - Rolling criteria, risk-adjusted return, open exposure, and risk-unit scoring
- Walk-Forward Research - Strategy walk-forward runs and generic prediction research workflows
- Chat on the ta4j Discord
- Explore the ta4j repository and its
ta4j-examplesmodule - How to Contribute - Development setup and contribution workflow
- Roadmap & Tasks - Planned work and known gaps
- Related Projects - Ecosystem projects built around ta4j
- Architecture proposals - Active design drafts and in-progress PRDs
- Architecture archive - Historical decisions and implementation records
- Completed feature dossiers - Delivered PRD/checklist records