Ta4j Wiki

Documentation, examples and further information of the ta4j project

View the Wiki On GitHub

This project is maintained by ta4j Organization

BarSeries Base/Quote Symbol Metadata (TODO PRD)

Status Snapshot (2026-03-06)

Status: still proposed, not implemented in ta4j-core.

What exists today:

Overview

Add optional symbol metadata to BarSeries so a series can explicitly carry its instrument identity without coupling ta4j to any external exchange library. This PRD proposes two new fields:

These values are simple String fields stored on the series (not on each bar), and are intended to be optional and purely informational.

Goals

Non-Goals

Proposed API

BarSeries (interface)

Add two optional getters:

String getBaseSymbol();
String getQuoteSymbol();

Default behavior: null if not set.

BaseBarSeries

Add fields:

private final String baseSymbol;
private final String quoteSymbol;

Builders

Extend the builders to capture metadata:

Serialization

BaseBarSeries and ConcurrentBarSeries serialization should include the new fields so round-trips preserve them.

Design Decisions

  1. Strings, not types: Strings avoid coupling to external symbol types.
  2. Optional: Null is valid; no migration required.
  3. No inference: Do not parse symbols out of the series name.
  4. Series-level: Bars remain data points, not metadata containers.

Implementation Plan

  1. Add getters to BarSeries
    • Update interface and any implementations.
  2. Add fields to BaseBarSeries
    • Thread through constructors.
  3. Update builders
    • Add withBaseSymbol/withQuoteSymbol (and optional withSymbolPair).
    • Pass into BaseBarSeries constructors.
  4. Propagate to sub-series
    • Ensure getSubSeries(...) retains metadata.
  5. Serialization updates
    • Ensure any serialization logic (Java or JSON) preserves fields.
  6. Documentation
    • Update javadocs in BarSeries and BaseBarSeriesBuilder.
  7. Tests
    • Add unit tests for builder, sub-series, and serialization round-trip.

File Impact (Expected)

Backward Compatibility

Testing Strategy

Acceptance Criteria

Open Questions

Rationale Notes (2026-03-06)