Overview
This node detects various candlestick patterns in financial OHLCV (Open, High, Low, Close, Volume) data using technical analysis. It is useful for traders and analysts who want to automatically identify key candlestick signals that indicate potential market reversals, continuations, or indecision.
Typical use cases include:
- Automated trading strategies that trigger actions based on recognized candlestick patterns.
- Market analysis workflows to highlight significant price action signals.
- Combining pattern detection with other indicators for enhanced decision-making.
For example, a user can input historical OHLCV data of a stock and select patterns like "Bullish Engulfing" or "Doji" to detect bullish reversal signals. The node outputs which patterns were detected along with optional metadata or the original data.
Properties
| Name | Meaning |
|---|---|
| Patterns | Select one or more candlestick patterns to detect. Options include common patterns such as Abandoned Baby, Bearish Engulfing, Bullish Hammer Stick, Doji, Morning Star, Shooting Star, etc. |
| OHLCV Data | JSON string containing an array of OHLCV data points. Each data point is expected to be an array with at least open, high, low, close values, and optionally volume. |
| Options | Collection of additional options: - Return Type: Choose output format: • Pattern Results Only • With OHLCV Data • With Metadata - Include Pattern Strength: Boolean to include strength indicators. - Minimum Data Points: Minimum number of OHLCV entries required for detection (default 5). |
Output
The node outputs a JSON object with the following structure:
detectedPatterns: Array of pattern names detected in the input data.patternResults: Object mapping each requested pattern to its detection result. This can be:- A boolean indicating presence,
- An array indicating detection per data point,
- Or an error message if detection failed.
patternLocations: Details about where patterns were found, including start/end indices and pattern length.totalPatternsChecked: Number of patterns checked.patternsDetected: Number of patterns detected.- Optional fields depending on options:
ohlcvData: Original OHLCV data array (if "With OHLCV Data" selected).metadata: Includes input length, patterns checked, detected patterns, and timestamp (if "With Metadata" selected).
patternStrength(optional): Object with calculated strength metrics for detected patterns, such as body size ratio and volume ratio.
If the node encounters errors parsing input or insufficient data points, it throws descriptive errors unless configured to continue on failure.
Dependencies
- Uses the
technicalindicatorslibrary for candlestick pattern detection functions. - Requires valid OHLCV data input as JSON string.
- No external API keys or services are needed.
- Runs entirely within n8n environment.
Troubleshooting
- Failed to parse OHLCV data: Ensure the input is a valid JSON string representing an array of arrays with OHLCV values.
- OHLCV data must be a non-empty array: Input data must not be empty and must be an array.
- Insufficient data points: The number of OHLCV entries must meet or exceed the minimum specified (default 5).
- Pattern function not found: If a selected pattern is not supported by the underlying library, an error will be reported for that pattern.
- To handle errors gracefully, enable "Continue On Fail" in the node settings.