Ta4j Wiki

Documentation, examples and further information of the ta4j project

View the Wiki On GitHub

This project is maintained by ta4j Organization

Elliott Wave Quickstart

Use this page when you want the shortest path to running Elliott Wave analysis in ta4j.

For full theory, component internals, scenario scoring, and advanced usage, see Elliott Wave Indicators.

BarSeries series = ...;
int index = series.getEndIndex();

// Optional: loosen/tighten Fibonacci validation for both phase() and scenarios()
Num fibTolerance = series.numFactory().numOf(0.25);
ElliottWaveFacade facade = ElliottWaveFacade.fractal(
        series, 5, ElliottDegree.INTERMEDIATE, Optional.of(fibTolerance), Optional.empty());

ElliottPhase phase = facade.phase().getValue(index);
ElliottScenarioSet scenarios = facade.scenarios().getValue(index);
Num invalidation = facade.invalidationLevel().getValue(index);

Use this path when you need indicator-style access inside rules or chart overlays.

For strategy entries/exits, prefer the public rules in org.ta4j.core.rules.elliott (for example ElliottScenarioConfidenceRule, ElliottImpulsePhaseRule, ElliottScenarioInvalidationRule) wired to facade.scenarios() — see Elliott Wave Indicators — Built-in scenario rules.

2) Use one-shot analysis for reports

ElliottWaveAnalysisRunner runner = ElliottWaveAnalysisRunner.builder()
        .degree(ElliottDegree.INTERMEDIATE)
        .logicProfile(ElliottLogicProfile.ORTHODOX_CLASSICAL) // optional 0.22.7 preset
        .build();
ElliottWaveAnalysisResult result = runner.analyze(series);

Use this path when you want report generation or standalone analysis steps.

3) Run a live five-outlook snapshot

Use the EW Snapshot Analysis workflow when you want a shareable, current macro-cycle report for a daily live instrument. This workflow is pending the ta4j repository change in ta4j/ta4j#1544; until that PR lands, use the local command below.

  1. Open the ta4j repository’s Actions tab.
  2. Select EW Snapshot Analysis.
  3. Choose Run workflow.
  4. Set the inputs, or keep the defaults:
    • instrument: BTC/USD
    • exchange: Coinbase
    • lookbackDays: 1825

The same workflow can analyze other supported daily live instruments, for example ETH/USD via Coinbase or AAPL via YahooFinance. The run summary and artifact names are generated from the selected instrument, exchange, and lookback window.

For a local run, use ElliottWavePresetDemo with a daily duration:

./mvnw -pl ta4j-examples -am exec:java \
  -Dexec.mainClass=ta4jexamples.analysis.elliottwave.ElliottWavePresetDemo \
  -Dexec.args="live Coinbase BTC-USD PT1D 1825"

Daily live runs (PT1D or PT24H) produce the macro-cycle package: one base case plus four alternate outlooks when enough distinct scenario candidates exist. Non-daily live runs continue to use the generic indicator-suite path.

The GitHub artifact contains:

Treat confidence and probability as ranking aids, not certainties. Invalidation levels are the risk boundaries for a count, and the alternate outlooks are intentionally kept visible so operators can monitor when the base case weakens.

4) Integrate into strategy logic

5) Verify with maintained examples