• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

cm45t3r / candlestick / 29552177465 / 3
100%
main: 100%

Build:
DEFAULT BRANCH: main
Ran 17 Jul 2026 03:22AM UTC
Files 29
Run time 1s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

17 Jul 2026 03:21AM UTC coverage: 99.679% (+0.04%) from 99.641%
29552177465.3

push

github

web-flow
feat(patternChain): trend-context-aware confidence, deprecate static confidence (#99)

* feat(patternChain): trend-context-aware confidence, deprecate static confidence

Pattern functions are evaluated independently with no shared trend
context. On real data (AAPL, 2025-07-22/23) this lets the identical
candle qualify as both `hammer` (bullish reversal, expects a preceding
downtrend) and `hangingMan` (bearish reversal, expects a preceding
uptrend) — opposite signals on the same shape, disambiguated only by
context. Each pattern's static `confidence` also can't distinguish a
textbook occurrence from a marginal one.

Adds an opt-in `trendContext` option to `patternChain`:

- `trendMethod: "sma-slope" | "ema-slope" | "pct-change"` — built-in
  trend measures (src/trend.js), signed fractions comparable across
  price levels.
- `externalTrend` / `trendFn` — escape hatches for callers with a more
  advanced trend/regime model, mirroring #96/#97's design for
  volatility (this package implements neither GARCH nor an HMM itself).
- Each match derives its expected preceding-trend direction from its
  existing `type`+`direction` metadata (src/contextFit.js):
  reversal patterns expect the OPPOSITE trend, continuation patterns
  expect the SAME trend, neutral patterns expect nothing. This is the
  exact rule that resolves the hammer/hangingMan contradiction above.
- Results carry `trendContext` (a coarse label) and `contextFit` (0-1).
  `enrichWithMetadata` additionally computes `effectiveConfidence`
  (`confidence * contextFit`) — the trend-aware alternative to the
  now-deprecated static `confidence` (kept for backward compatibility,
  marked `@deprecated` in JSDoc/types, not scheduled for removal before
  a major version).
- `resolveConflicts: true` optionally drops the lower-`contextFit` side
  of a same-candle, opposite-direction conflict (default: surface both).

Reuses `src/seriesResolver.js` (#97) for the method/external/callback
resolution, same precede... (continued)

779 of 786 branches covered (99.11%)

Branch coverage included in aggregate %.

3254 of 3260 relevant lines covered (99.82%)

3926.02 hits per line

Source Files on job run-windows-latest-20.x - 29552177465.3
  • Tree
  • List 29
  • Changed 9
  • Source Changed 2
  • Coverage Changed 9
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Build 29552177465
  • 6056dbfc on github
  • Prev Job for on main (#29127823745.3)
  • Next Job for on main (#29552351244.4)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc