The Hammer and the Hanging Man Are the Same Candle
Описание и применение
Библиотека candlestick решает проблему неоднозначных сигналов «молот» и «повешенный» путем оценки контекста тренда и вычисления контекстного коэффициента, тем самым повышая надёжность сигналов и снижая потребление памяти при потоковой обработке.
Задача
Pattern detection libraries often return both hammer and hanging man for the same candle, leaving users to decide which signal to trust based on prior trend context.
Результат
By incorporating trend context and contextFit, the library eliminates ambiguous hammer/hanging‑man signals, improves signal reliability, and reduces memory usage with streaming support.
Рабочий процесс
- 1. Import candlestick and required functions.
- 2. Call patternChain with data, allPatterns, and trendContext options (e.g., trendMethod:'sma-slope', trendPeriod:10).
- 3. Inspect returned matches; each includes trendContext and contextFit.
- 4. Use metadata.enrichWithMetadata to compute effectiveConfidence (confidence × contextFit).
- 5. Optionally set resolveConflicts:true to drop weaker opposite‑direction matches.
- 6. Consume matches via onMatch callback or process the array as needed.
Доказательства
Same uptrend, same long-lower-wick geometry, and the library tells you which reading the context supports.
Passing resolveConflicts:true goes further and drops the weaker side of a same-candle, opposite-direction conflict outright.
- Дата записи: 2026-09-20T08:16:50.486Z