feat: add Ichimoku & Charts deepening (B13, 5 indicators) (#207)

B13 of the family-deepening roadmap — five alternative-chart indicators (474 -> 479), all in the **Ichimoku & Charts** family.

- **Smoothed Heikin-Ashi** (`candle -> struct {open, high, low, close}`) — a Heikin-Ashi candle computed from EMA-smoothed OHLC.
- **Heikin-Ashi Oscillator** (`candle -> f64`) — the HA body (`ha_close - ha_open`), optionally EMA-smoothed, as a zero-line oscillator.
- **Three Line Break** (`candle -> f64`) — line-break ("kakushi") chart trend direction; reverses only when the close breaks the extreme of the last N lines. Distinct from the candlestick `ThreeLineStrike`.
- **Equivolume** (`candle -> struct {height, width}`) — a box whose height is the bar range and width is volume-relative.
- **CandleVolume** (`candle -> struct {body, width}`) — a candle whose body is close-minus-open and width is volume-relative.

All bindings hand-written (3 struct-output + 2 candle-input-with-open / non-period-ctor). Wiring complete across core, Python, Node, WASM, fuzz, tests, README + docs counter (479) and CHANGELOG. Verified: core 3915 + doc 432, clippy clean, node 554, python 913.
This commit is contained in:
kingchenc
2026-06-08 01:49:03 +02:00
committed by GitHub
parent 57e26fb22f
commit ceaeb90a22
19 changed files with 2399 additions and 58 deletions
@@ -382,6 +382,14 @@ def test_relative_strength_streaming_matches_batch():
# 6-tuple candle; the batch helper takes only the columns it needs.
CANDLE_SCALAR = {
"ThreeLineBreak": (
lambda: ta.ThreeLineBreak(3),
lambda ind, h, l, c, v: ind.batch(h, l, c),
),
"HeikinAshiOscillator": (
lambda: ta.HeikinAshiOscillator(5),
lambda ind, h, l, c, v: ind.batch(c, h, l, c),
),
"TDDWave": (
lambda: ta.TDDWave(2),
lambda ind, h, l, c, v: ind.batch(h, l, c),
@@ -976,6 +984,21 @@ def test_candle_scalar_streaming_matches_batch(name, ohlcv):
# --- Candle-input, multi-output indicators --------------------------------
MULTI = {
"CandleVolume": (
lambda: ta.CandleVolume(20),
lambda ind, h, l, c, v: ind.batch(c, c, v),
2,
),
"Equivolume": (
lambda: ta.Equivolume(20),
lambda ind, h, l, c, v: ind.batch(h, l, v),
2,
),
"SmoothedHeikinAshi": (
lambda: ta.SmoothedHeikinAshi(5),
lambda ind, h, l, c, v: ind.batch(c, h, l, c),
4,
),
"TDMovingAverage": (
lambda: ta.TDMovingAverage(5, 13),
lambda ind, h, l, c, v: ind.batch(h, l),
@@ -3235,6 +3258,26 @@ def test_td_trap_reference():
assert t.update((106.0, 112.0, 100.0, 109.0, 1.0, 2)) == pytest.approx(1.0)
def test_heikin_ashi_oscillator_reference():
t = ta.HeikinAshiOscillator(5)
def test_three_line_break_reference():
t = ta.ThreeLineBreak(3)
def test_smoothed_heikin_ashi_reference():
t = ta.SmoothedHeikinAshi(5)
def test_equivolume_reference():
t = ta.Equivolume(20)
def test_candle_volume_reference():
t = ta.CandleVolume(20)
# --- Lifecycle ------------------------------------------------------------