Ta4j Wiki

Documentation, examples and further information of the ta4j project

View the Wiki On GitHub

This project is maintained by ta4j Organization

Charting Quickstart

Use this page when your goal is simple: render a strategy result quickly and verify signals visually.

For full API coverage, advanced configuration, and styling details, see Charting.

1) Build a base chart

ChartWorkflow chartWorkflow = new ChartWorkflow();
JFreeChart chart = chartWorkflow.builder()
        .withSeries(series)
        .toChart();

2) Add strategy signals

TradingRecord record = new BarSeriesManager(series).run(strategy);

JFreeChart chart = chartWorkflow.builder()
        .withSeries(series)
        .withTradingRecordOverlay(record)
        .toChart();

3) Add indicator overlays

ClosePriceIndicator close = new ClosePriceIndicator(series);
SMAIndicator sma = new SMAIndicator(close, 50);

JFreeChart chart = chartWorkflow.builder()
        .withSeries(series)
        .withIndicatorOverlay(sma)
        .toChart();

4) Handle market-time gaps

Use TimeAxisMode.BAR_INDEX when you want evenly spaced bars (for markets with weekends/holidays):

JFreeChart chart = chartWorkflow.builder()
        .withTimeAxisMode(TimeAxisMode.BAR_INDEX)
        .withSeries(series)
        .toChart();

5) Troubleshoot quickly