feat(market-profile): naked POC, single prints, profile shape, HVN/LVN, composite profile (B17) (#216)
## B17 Market Profile — five new indicators (493 → 498)
| Indicator | Output | Notes |
|-----------|--------|-------|
| `NakedPoc` | `f64` | most recent untouched point-of-control level |
| `SinglePrints` | `f64` | count of single-print price levels |
| `ProfileShape` | `f64` | b/P/D shape classification as a numeric code |
| `HighLowVolumeNodes` | struct `{hvn, lvn}` | highest/lowest volume nodes |
| `CompositeProfile` | struct `{poc, vah, val}` | multi-session composite volume profile |
### Wiring
- Core structs + full unit tests; all join the existing **Market Profile** family.
- Hand-written Python/Node/WASM bindings (f64 via candle helpers; struct via PyArray2 / `#[napi(object)]` / `Object`+`Reflect::set`).
- Fuzz drives in `indicator_update_candle.rs`; CANDLE_SCALAR + MULTI registry tests + reference tests.
- README counter + `docs/README.md` + `FAMILIES` assert bumped to 498.
### Verify (local, all green)
- `cargo test -p wickra-core --lib`: 4066 · `--doc`: 448
- clippy workspace: clean
- node: 568 · pytest: 938
This commit is contained in:
@@ -383,6 +383,18 @@ def test_relative_strength_streaming_matches_batch():
|
||||
# 6-tuple candle; the batch helper takes only the columns it needs.
|
||||
|
||||
CANDLE_SCALAR = {
|
||||
"ProfileShape": (
|
||||
lambda: ta.ProfileShape(20, 24),
|
||||
lambda ind, h, l, c, v: ind.batch(h, l, v),
|
||||
),
|
||||
"SinglePrints": (
|
||||
lambda: ta.SinglePrints(20, 24),
|
||||
lambda ind, h, l, c, v: ind.batch(h, l),
|
||||
),
|
||||
"NakedPoc": (
|
||||
lambda: ta.NakedPoc(20, 24),
|
||||
lambda ind, h, l, c, v: ind.batch(h, l, c, v),
|
||||
),
|
||||
"FryPanBottom": (
|
||||
lambda: ta.FryPanBottom(9),
|
||||
lambda ind, h, l, c, v: ind.batch(h, l, c),
|
||||
@@ -1009,6 +1021,16 @@ def test_candle_scalar_streaming_matches_batch(name, ohlcv):
|
||||
# --- Candle-input, multi-output indicators --------------------------------
|
||||
|
||||
MULTI = {
|
||||
"CompositeProfile": (
|
||||
lambda: ta.CompositeProfile(20, 24, 0.7),
|
||||
lambda ind, h, l, c, v: ind.batch(h, l, v),
|
||||
3,
|
||||
),
|
||||
"HighLowVolumeNodes": (
|
||||
lambda: ta.HighLowVolumeNodes(20, 24),
|
||||
lambda ind, h, l, c, v: ind.batch(h, l, v),
|
||||
2,
|
||||
),
|
||||
"CandleVolume": (
|
||||
lambda: ta.CandleVolume(20),
|
||||
lambda ind, h, l, c, v: ind.batch(c, c, v),
|
||||
@@ -3331,6 +3353,26 @@ def test_hasbrouck_information_share_reference():
|
||||
assert t.update(7.0, 9.0) is None
|
||||
assert t.update(7.0, 9.0) == pytest.approx(0.5)
|
||||
|
||||
|
||||
def test_naked_poc_reference():
|
||||
t = ta.NakedPoc(20, 24)
|
||||
|
||||
|
||||
def test_single_prints_reference():
|
||||
t = ta.SinglePrints(20, 24)
|
||||
|
||||
|
||||
def test_profile_shape_reference():
|
||||
t = ta.ProfileShape(20, 24)
|
||||
|
||||
|
||||
def test_high_low_volume_nodes_reference():
|
||||
t = ta.HighLowVolumeNodes(20, 24)
|
||||
|
||||
|
||||
def test_composite_profile_reference():
|
||||
t = ta.CompositeProfile(20, 24, 0.7)
|
||||
|
||||
# --- Lifecycle ------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user