$ show cm45t3r/candlestick
This repository is a zero-dependency JavaScript library for detecting 18 candlestick patterns (29 variants) in financial OHLC data. It provides a consistent API per pattern (boolean check and array scanner), a multi-pattern scanner with optional trend context for confidence adjustment, a streaming API for memory-efficient processing of large datasets, a plugin system for custom patterns, and a CLI tool for quick analysis. The library supports both CommonJS and ES Modules, includes TypeScript definitions, and is extensively tested with unit, integration, and property-based tests. It is designed for use in trading systems, backtesting, and algorithmic trading applications.
The LLM identified 2 files worth highlighting for reuse:
A self-contained collection of pure functions for computing candle properties (body length, wick length, tail length, bullishness), validating OHLC data, and a generic `findPattern` utility that adapts to variable parameter counts. These functions are used by every pattern module but have no internal dependencies, making them independently reusable in any candlestick analysis project.
A minimal plugin registry that allows registering custom pattern detection functions with metadata (confidence, type, direction, paramCount). It provides `registerPattern`, `getPattern`, and `clearAllPatterns` methods. The registry is a singleton but can be cleared, and the API is fully decoupled from the core pattern detection logic, making it extractable for any project needing a plugin architecture.