33 Commits
Author SHA1 Message Date
Emerson GomesandCursor 70b53189b9 fix(patterns): stop silent degradation and untrue availability claims
Pattern detection had two recurring defects: a fallback that quietly
substituted different data than the caller asked for, and metadata that
asserted a point-in-time or guarantee the computation could not support.

Data substitution:

- Denoising on the classic/harmonic/elliott/fractal path smoothed only
  `close`, so the smoothed close routinely fell outside its own raw candle
  and ~68% of rows were reverted to raw -- preferentially at the local
  extremes pivot detection keys on. Require the full OHLC set, matching the
  candlestick path, and reject an explicitly partial column list.
- A failed denoise still echoed the requested spec with
  `preprocessing_causality: "causal"`. Report `denoise_applied: false`,
  `denoise_error` and `preprocessing_causality: "raw_prices"` instead.
- One non-finite OHLC value makes the aggregate candlestick dispatcher
  throw, leaving only the few directly-attached detectors. The failure was
  unrecorded because `dispatch_names` is the string "all", not a list. Add a
  `detector_coverage` block plus a warning, and surface names the installed
  backend does not provide (`outside` is absent from pandas-ta-classic).

Untrue claims:

- Elliott `available_at_index` was 67% irreproducible when re-running over a
  window truncated at that index, because pivot spacing and (under the
  default `scale_mode="auto"`) the swing scale are whole-window statistics.
  Report the right edge as the guarantee and demote the confirmation-derived
  figure to `earliest_possible_index_estimate` with a caveat, matching the
  harmonic contract. Also track when a min-distance choice was settled so a
  pivot surviving a later challenge is not claimed knowable at its own bar.
- The "no patterns detected in N bars" note omitted `observed_bars` outside
  candlestick mode, asserting absence over bars never fetched.
- `df.attrs["pattern_ohlc_fallback"]` was written for the API layer to
  disclose and never read, and was written after a slice so it could not
  reach the caller. Wire it into warnings and report `analyzed_bars` when a
  detector caps its own input window.
- `data_freshness` emitted the literal string "None", which is truthy and
  then broke the year parse that would have raised a staleness warning.

Silent no-ops and misattribution:

- The documented `mode="all"` namespacing (`{"harmonic": {...}}`) reported
  the section name as an invalid key and failed the fractal and harmonic
  sections. Validate a section's contents against that detector, and
  attribute an unknown top-level key to every detector that could own it
  rather than only fractal and harmonic.
- `detail="summary"` dropped `warnings`, `data_quality`, `candles` and
  `effective_window` -- exactly the fields that say not to trust a result.
- `min_strength`, `min_gap` and `robust_only` were accepted and ignored
  outside candlestick mode; reject a non-default value like the adjacent
  `engine` and `whitelist` guards do.
- Fractal `include_stale_levels` was discarded by the visibility allowlist
  unless `include_completed` was also set, and stale rows were hidden
  without being counted.
- Six Elliott config knobs were unread: the four rule/classifier blend
  weights (no blend exists; an existing test pinned that) and two additive
  unconfirmed-pattern penalties superseded by the confidence cap. Remove
  them so they become explicit unknown-key errors.

Scoring correctness:

- Candlestick geometry keyed its body-size expectation off the deprioritize
  set, so hammers, shooting stars and harami were scored as if a large body
  confirmed them, while marubozu was scored as if a small one did. Classify
  the expectation per pattern.
- A zero-range bar scored `body_ratio = 0.5` ("unknown"), making a perfect
  doji rank below an imperfect one; it has a zero body by construction.
- `min_gap` spaced candidates selected at threshold 0.0, so a weak hit could
  consume the slot and erase a qualifying signal one bar away. Space among
  rows that meet `min_strength`.
- `inside` was signed by candle colour, contradicting the harami detected on
  the identical bars and defeating the dedupe that exists to replace it.
  Report it as non-directional and let the specific form suppress it.
- A hikkake confirmation bar (magnitude 200) was given the three-bar setup
  span, putting `start_index` inside the setup.
- Candlestick `recency` used the reported bar count while `end_index` indexes
  the warmup-inclusive frame, clamping `bars_ago` to 0 for every pattern in
  the warmup span and biasing the cross-detector ranking.
- Volume-confirmation warmup ignored pattern span, so a multi-bar pattern on
  the first visible bar had a short baseline.

Verified: ruff clean, 10115 backend tests pass, schemas 83/83.
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 13:54:32 -05:00
Emerson Gomes 69e2eeb0e8 fix(forecast): preserve analog search semantics 2026-08-30 19:09:19 -05:00
Emerson Gomes 22564d2a17 fix(docs): update pattern detection contract 2026-08-25 16:14:42 -05:00
Emerson Gomes d81388c514 fix(patterns): stop recommending long_setup after harmonic targets
Completed harmonics now track post-completion OHLC so target_reached and expired structures are historical, not current long/short setups. Compact output still keeps target and invalidation prices.
2026-08-25 10:37:47 -05:00
Emerson Gomes 9195f15b11 fix(docs): flatten Windows-hostile bash CLI continuations 2026-08-24 20:29:50 -05:00
Emerson Gomes 12850307bc fix(patterns): clarify top-k output scope 2026-08-20 17:06:18 -05:00
Emerson Gomes 6ab1a366b2 fix(patterns): dispatch aggregate candlestick names 2026-08-20 17:03:00 -05:00
Emerson Gomes e99ecf336d fix(core): signal partial composite failures 2026-08-20 13:46:15 -05:00
Emerson Gomes 3a540ef7af fix(validation): reject unknown method parameters 2026-08-20 09:27:16 -05:00
Emerson Gomes 3247f8b39b docs: close coverage gaps and enforce a beginner-friendly persona
Add User/Operator/Contributor tags, Web UI and MCP tours, and market/news/wait guides. Correct stale Web API trading claims and simplify first-hour paths.
2026-08-13 13:05:04 -05:00
Emerson Gomes 671f5c5882 fix(cli): reserve limit for returned rows 2026-08-12 19:10:48 -05:00
Emerson Gomes 616c546049 deps: migrate supported dependency stack 2026-08-11 08:23:04 -05:00
Emerson Gomes 217468c087 fix(patterns): confirm classic pivots causally 2026-08-07 21:56:18 -05:00
Emerson Gomes ae4df46fcd docs: align feature, pattern, and theta contracts 2026-08-06 20:16:28 -05:00
Emerson Gomes e6efb937d6 docs update 2026-08-01 17:11:00 -05:00
Emerson Gomes 1698ec2b72 fix(patterns): make detection evidence geometrically truthful 2026-08-01 07:07:15 -05:00
Emerson Gomes 798746dcd1 docs: improve and correct user guides 2026-07-13 17:15:01 -05:00
Emerson Gomes 94ddcd0e3f patterns: clarify robust candlestick preset 2026-07-13 16:23:02 -05:00
Emerson Gomes 69f147c806 docs: align pattern search defaults 2026-07-12 20:20:12 -05:00
Emerson Gomes 04955d9678 patterns: separate fractal level lifecycle 2026-07-12 18:45:50 -05:00
Emerson Gomes 96310086ed patterns: clarify classic result bounds 2026-07-12 18:40:29 -05:00
Emerson Gomes 2170e6acd2 patterns: expose harmonic detections by default 2026-07-12 18:40:00 -05:00
Emerson Gomes 97af0f4159 patterns: add harmonic pattern detection 2026-06-01 13:53:09 -05:00
Emerson Gomes cf31a32d04 add fractal pattern detection 2026-04-12 15:04:31 -05:00
Emerson Gomes 3b25be92d4 docs: add optional native accelerator install path 2026-04-11 17:46:58 -05:00
Emerson Gomes 4860d355ed docs: clarify optional accelerator backends 2026-04-11 17:17:28 -05:00
Emerson Gomes 22c2497559 update docs 2026-04-11 15:19:47 -05:00
Emerson Gomes 7165f556ab patterns: redesign candlestick strength semantics 2026-03-16 20:08:02 -05:00
Emerson Gomes 410fa181cb core: finish forecast coherence cleanup 2026-03-14 10:01:20 -05:00
Emerson Gomes c9b041fed5 core: drop wrapper entrypoints 2026-03-06 22:20:53 -06:00
Emerson Gomes 6b138875ba core: replace --format with --json and unify TOON/JSON output 2026-03-01 18:07:30 -06:00
Emerson Gomes dd3cf57eed docs: overhaul documentation with glossary, cross-links, and verified examples; fix type errors in CLI and server 2026-01-01 18:36:41 -06:00
Emerson Gomes efb6bbad56 docs revamp 2026-01-01 17:26:37 -06:00