Requirements
- JDK 21 or later. ta4j requires Java 21+. The build enforces this via the Maven Enforcer plugin. Check your installed version with
java -version. - Maven 3.9+ or Gradle 8+. Either build tool works.
Add ta4j-core
ta4j-core is the main library. It contains all indicators, rules, strategies, the backtesting engine, and analysis criteria.
Optional: ta4j-examples
ta4j-examples is a companion module that provides:
- Data loaders —
YahooFinanceHttpBarSeriesDataSource,CoinbaseHttpBarSeriesDataSource,CsvFileBarSeriesDataSource, andJsonFileBarSeriesDataSource, all implementing the unifiedBarSeriesDataSourceinterface. - Charting utilities —
ChartWorkflowfor building candlestick charts with indicator overlays and performance subcharts using JFreeChart. - Runnable demos — Complete, well-commented examples covering backtesting, multi-strategy comparison, live trading patterns, and Elliott Wave analysis.
Snapshot builds
Every push to themaster branch publishes a snapshot to Sonatype’s snapshot repository. Snapshots contain the latest merged changes and are useful for testing upcoming features before a stable release.
Snapshot builds are not guaranteed to be stable. APIs may change between snapshots and the published stable release. Do not use snapshots in production.
Build from source
Building from source gives you the very latest code, including any changes not yet published as a snapshot.0.22.6-SNAPSHOT artifacts are available in your local ~/.m2/repository. Reference them the same way as any other dependency.
The build uses the Maven Wrapper (
mvnw), which downloads and uses the exact Maven version pinned in .mvn/wrapper/maven-wrapper.properties. You do not need a global Maven installation, though you can substitute mvn if you prefer your local installation.Verify the installation
Once you have added the dependency, confirm it resolves correctly by creating a minimal class:ta4j installed correctly. Bar count: 0, your setup is working.
Next steps
Quick Start
Build your first strategy and run a complete backtest.
Data sources
Load market data from Yahoo Finance, Coinbase, CSV, or your own source.