Documentation, examples and further information of the ta4j project
This project is maintained by ta4j Organization

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.
BarSeriesManager and BacktestExecutor can now stay on the default next-open model or switch to current-close, slippage, or stop-limit execution.BacktestExecutionResult#getTopStrategiesWeighted(...) and WeightedCriterion let you rank strategies by a normalized composite score instead of a single raw metric.TradeFill values directly with TradingRecord.operate(fill) or group an order with Trade.fromFills(...), then inspect getCurrentPosition() and getOpenPositions() on the same record.SharpeRatioCriterion, SortinoRatioCriterion, CalmarRatioCriterion, OmegaRatioCriterion, and volume pressure indicators such as ForceIndexIndicator, EaseOfMovementIndicator, and KlingerVolumeOscillatorIndicator.BarSeriesManager and BacktestExecutor, then Live Trading for event-driven loops.| Scenario | Recommended path | Core classes |
|---|---|---|
| Quick historical validation | BarSeriesManager |
BarSeriesManager, BaseTradingRecord, TradeExecutionModel |
| Parameter sweeps and leaderboards | BacktestExecutor |
BacktestExecutor, WeightedCriterion, BacktestRuntimeReport |
| Deterministic replay with a preconfigured record | BarSeriesManager.run(..., tradingRecord, ...) |
BaseTradingRecord, ExecutionMatchPolicy |
| Live or paper execution with asynchronous fills | Manual loop | Strategy, TradingRecord, TradeFill, Trade.fromFills(...), ConcurrentBarSeries |
| Older live adapter compatibility | Temporary bridge only | LiveTradingRecord, ExecutionFill |
The key change is simple: new code no longer needs a split “backtest record” versus “live record” mental model. BaseTradingRecord already supports classic enter / exit operations, fill-aware updates, open-lot views, recorded fees, and open-position criteria.
BarSeriesManager, BacktestExecutor, or a manual simulation loopConcurrentBarSeries, broker-confirmed fills, persistence, and downstream integration patternsQuickstart, TradingRecordParityBacktest, TradeFillRecordingExample, and SimpleMovingAverageRangeBacktestta4j-examples module