Library / SDK
ta4j/ta4j avatar
ta4j/ta4j

ta4j: five types, no DSL, and a forecasting row nobody expects

A Java library for technical analysis.

2,533 stars806 forksJavaNOASSERTION

At a glance

What is it?
ta4j is a Java technical analysis library whose core model is five types in a line, from a bar series through indicators and rules to a strategy and a trading record. Its execution modelling is unusually thorough, it ships a forecasting module with Kalman and conformal methods, its readme is machine-rewritten around version blocks, and there is no licence file in the repository root.
Who is it for?
ta4j fits a Java team that wants to state a trading idea in typed code, test it under explicit cost assumptions, and keep the same strategy logic for live use, without standing up a Python service or learning a proprietary rule language. It does not fit someone who wants a data feed, a broker connection or execution infrastructure, because the project is explicit that market data and connectivity stay with your application.
Can I use it commercially?
Check first. The repository uses a licence we do not classify automatically, so read its LICENSE file before any commercial use.
Is it still maintained?
Yes. The repository last received commits 3 days ago.
What is it written in?
Mainly Java, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.

From daily snapshots

Star history

  • ta4j/ta4j2,533 ★ · +39
Star history
Repository2026-09-302026-11-15
ta4j/ta4j2.5k2.5k

39 Stars in the last 46 days, measured from the daily GitHub snapshot. Compare with other projects

Editorial analysis

The model is five types, and there is no rule language to learn

The whole API is summarised in one arrow in the readme: a bar series feeds an indicator, the indicator feeds a rule, the rule feeds a strategy, and the strategy produces a trading record. The workflow line expands it once more with the ends attached, from market data through the series, indicators and rules into a strategy, then either a backtest or a live evaluation, and finally metrics and charts. What the project is selling with that shape is being typed and composable, with fluent indicator, rule and strategy objects, and specifically with no strategy DSL you have to learn, no Python bridge, and no separate service. The pitch also says what it is not claiming: the goal is reproducible research rather than guaranteed returns, and market data and broker connectivity stay under your control. That is the right thing for a library to say, and it also tells you the boundary of the project. If you want a backtest, this is the tool. If you want a venue connection, it is not.

Java 25, one module, and four version blocks a script rewrites

The install section is short and the requirement is a high one: Java 25 or newer, which will decide the question for a lot of teams before anything else. Most applications need a single module, and the dependency is spelled out for both the stable and the snapshot channel:

xml
<dependency>
  <groupId>org.ta4j</groupId>
  <artifactId>ta4j-core</artifactId>
  <version>0.25.0</version>
</dependency>

Snapshots come from a separate repository block with releases disabled and snapshots enabled, and the snapshot version is the next number with a snapshot suffix. A second artifact, the examples module, is offered for runnable demos, sample data sources and charting, and the readme is careful to say the core does not require it. The structural detail worth noticing is that every one of those four snippets is wrapped in an HTML comment marker naming which artefact and which channel it belongs to. That is a readme being rewritten by a script on release, which is how a library keeps its install instructions from going stale, and it also means the version numbers in the readme are generated rather than typed.

Running the example builds the whole reactor once, then execs one class

The quick start does not skip the build step, which is the sort of honesty that saves an afternoon. You clone the repository, change into it, build the reactor while skipping the tests, and then run the default example from the examples module:

bash
git clone https://github.com/ta4j/ta4j.git
cd ta4j

# Build the reactor once, then run the default Quickstart example.
./mvnw -DskipTests install
./mvnw -pl ta4j-examples exec:java

On Windows the wrapper has its own name and the readme says so. What the example does is described rather than shown: it loads bundled Bitcoin data, evaluates a strategy, prints performance metrics, and displays a chart when a graphical environment is available, which is a careful phrasing for a library that has to run on a build server. To try a different example you override the main class on the same command, and the readme names one specifically, a backtest that compares two ways of producing a trading record. Bundled data first is the right order for a quick start, since it means the first run needs no network and no account.

Execution realism is a first-class row, not a footnote

Most backtesting failures are not strategy failures, they are assumptions nobody wrote down, so the capability table gives execution its own row and it is the longest list in the table. It covers transaction costs and borrowing costs, slippage, stop limit fills, position sizing, partial fills, and lot matching. That last pair is what separates a paper result from a plausible one: partial fills model execution of only part of an order, while lot matching determines which opening lots are associated with a close for accounting purposes. The documentation shows how that reaches code, by constructing a trading record through a manager that takes the series and a cost model, and the complete README example runs the strategy with transaction and borrowing cost models, then calculates net return and maximum drawdown. If your current backtest assumes fills at the close and full fills at size, moving to a library that models those two things explicitly will change your results without changing your strategy.

The forecasting row is the one nobody expects from a charting library

Sitting in the capability table, between analysis and live integration, is a row about forecasting that has nothing to do with indicators: causal forecast state and projection APIs for Monte Carlo, analog, Kalman and conformal workflows. Four distinct methods, named in one line, in a library whose headline is technical analysis. Read strictly it is a claim that the library can hold a forecast state as a first class object and project from it, which is a modelling primitive rather than a strategy, and it explains why the analysis row bothers to mention JSON serialisation at all: a forecast you cannot export is a forecast you cannot put in front of a reviewer. The neighbouring row is the more familiar one, live integration, and its wording is careful. The point is not that the library executes orders but that you can reuse the strategy logic while your own application keeps ownership of data ingestion, order routing, reconciliation and recovery.

A shared loader model and five sources, with production left to you

Market data is handled in two layers, and the split is deliberate. The core module works with any source of open, high, low, close and volume bars, and the examples module ships a shared data source model plus ready to run loaders: one for a large market data provider covering stocks, exchange traded funds and crypto, one for a crypto exchange's pairs, loaders for comma separated and JSON files, and one that reads trade level rows from an exchange export rather than pre-aggregated bars. The last of those matters more than it looks, because bar construction from trades is where gap handling and fill assumptions get decided. Then the production instruction, which is the part to quote in a design document: adapt your broker, exchange, database, REST API or websocket feed into bars yourself, and keep normalisation, gap handling and corporate action adjustments explicit rather than inherited. The library is declining to own the part of the problem where quiet data bugs live.

A licence badge, a header template, and no licence file

Repository housekeeping here is heavier than the code, and one detail is worth raising early. The badge in the title row links to the MIT licence text, and the project is described as open source throughout, but the repository root contains no licence file. What it contains instead is a source file header template, which is what the build uses to stamp the licence into every file it generates, and that is a common and defensible pattern. It is still not the same artefact as a licence file, and the repository record for the project carries no recognised licence identifier, so the authoritative text is the badge link and the template. Two smaller things sit beside it. The recorded homepage is served over plain http while both documentation sites are separate pages hosted for the project, a wiki and the generated API documentation. And the root carries three documents about how to work on the code, one for coding assistants, one about reviewing Java specifically, and one about pull requests, alongside a release process, a changelog, an authors file, a code of conduct, a security policy and a documentation generator configuration.

Editorial conclusion

ta4j fits a Java team that wants to state a trading idea in typed code, test it under explicit cost assumptions, and keep the same strategy logic for live use, without standing up a Python service or learning a proprietary rule language. It does not fit someone who wants a data feed, a broker connection or execution infrastructure, because the project is explicit that market data and connectivity stay with your application. Before you adopt it, check four things. Which Java you are on, since the floor is 25. Which module you actually need, since only the core is required and the examples module is for learning. Which cost assumptions you model, because the difference between a backtest that clears and one that does not is entirely in the execution realism row. And which licence text governs, since the badge says MIT while the repository itself carries a header template rather than a licence file.

Frequently asked questions

What is ta4j used for?

It is a Java library for technical analysis and trading system research: you build indicators and rules, compose them into a strategy, backtest the strategy under explicit cost and execution assumptions, inspect the results, and reuse the same logic in live applications. The goal is reproducible research rather than guaranteed returns, and data and broker connectivity stay under your control.

What does ta4j require to build and install?

Java 25 or newer. Most applications need only the core artifact from Maven with the group identifier org.ta4j; a separate examples artifact exists for runnable demos and sample data sources and is not required by the core. Snapshot builds are published to a separate snapshot repository with a snapshot version.

How do I run the ta4j examples?

Clone the repository, build the reactor once with the Maven wrapper while skipping tests, then run the examples module through the same wrapper with the exec goal. The default example loads bundled Bitcoin data, prints metrics and draws a chart when a graphical environment is available, and you can pick a different example by overriding the main class.

Does ta4j connect to brokers or market data providers for me?

No. The core works with any source of price and volume bars, the examples module ships loaders for a market data provider, a crypto exchange, comma separated and JSON files, and trade level exchange exports, and the documentation says to adapt your own broker, exchange, database or feed in production while keeping normalisation, gap handling and corporate action adjustments explicit.

Official sources

  1. Issues
  2. Project website
  3. README
  4. Releases
  5. ta4j/ta4j on GitHub
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/ta4j-ta4j.svg)](https://hysenlabs.com/projects/ta4j-ta4j)

Star history chart for your README

markdown
[![Star history](https://hysenlabs.com/chart/ta4j-ta4j.svg)](https://hysenlabs.com/projects/ta4j-ta4j)

Was this useful?