Candlestick Architecture Engine [JOAT]Candlestick Architecture Engine
Introduction
Candlestick Architecture Engine is an open-source candlestick pattern recognition system that identifies ten structural patterns, scores each occurrence against volume and momentum context, and produces a composite signal rather than treating every detected pattern as equally valid. The central problem with most candlestick indicators is that they fire indiscriminately — a hammer in a confirmed uptrend with declining volume carries the same visual weight as a hammer at a major support with a volume surge. This indicator treats pattern geometry as the starting condition and context filters as the final arbiters.
Core Concepts
1. Pattern Geometry Engine
Each pattern is defined by structural ratios derived from the candle's open, high, low, and close. Body ratio, wick ratio, and the relationship between the current candle and its neighbors determine whether the pattern condition is met:
bodySize = math.abs(close - open)
candleSize = high - low
bodyRatio = candleSize > 0 ? bodySize / candleSize : 0.0
upperWick = high - math.max(open, close)
lowerWick = math.min(open, close) - low
Patterns include: bullish and bearish engulfing, hammer, inverted hammer, shooting star, doji, inside bar, morning star, evening star, and pin bar. Each has configurable sensitivity thresholds.
2. Composite Strength Scoring
When a pattern's geometry condition is met, the indicator computes a strength score from three factors: volume relative to its moving average, RSI position (whether the pattern appears at an extreme), and whether the pattern aligns with the dominant trend direction. Each factor contributes to a 0–100 score. Only patterns exceeding the minimum score threshold are labeled on the chart.
3. Volume Context Filter
Patterns at above-average volume are treated as structurally significant. The volume multiplier threshold is configurable — raising it to 1.5× or 2× restricts signals to only the highest-conviction events on that timeframe.
4. Candle Coloring
Candles are painted based on the most recent pattern signal and its directional implication. Bullish pattern candles shift toward the bull color palette; bearish patterns toward the bear palette. Neutral candles revert to the default coloring scheme.
Features
Ten candlestick pattern types: Engulfing (bull/bear), hammer, inverted hammer, shooting star, doji, inside bar, morning/evening star, pin bar
Composite strength score (0-100): Volume, RSI position, and trend alignment factored per pattern
Minimum score gate: Only patterns meeting the strength threshold are labeled
Volume confirmation filter: Configurable volume multiplier required at pattern bar
Candle coloring by pattern direction: Visual color shift when a valid pattern is detected
On-chart labels: Pattern name and strength score displayed at each signal
Dashboard: Current pattern state, last pattern name, score, and volume status
All patterns confirmed bar only: No repainting
Input Parameters
Pattern Configuration:
Body Ratio Threshold: Minimum body-to-candle ratio for engulfing classification (default: 0.6)
Wick Ratio Threshold: Minimum wick-to-candle ratio for hammer/pin classification (default: 0.55)
Doji Body Max: Maximum body size as fraction of candle range for doji (default: 0.1)
Signal Filters:
Minimum Strength Score: 0–100 gate for pattern labeling (default: 40)
Volume Multiplier: Volume required above average (default: 1.2)
RSI Length: RSI period for position scoring (default: 14)
How to Use This Indicator
Step 1: Set the Strength Threshold
Start with the default score of 40. Raise it to 60–70 if you want only the highest-confidence patterns. Lower it for more frequent signals on shorter timeframes.
Step 2: Use Patterns as Confirmation, Not Entry Triggers
A bullish engulfing at a key support level with a score above 60 and above-average volume is a meaningful structural event. Use it to confirm a bias established by another tool — not as a standalone entry signal.
Step 3: Watch Volume at Pattern Bars
The volume multiplier in the dashboard tells you whether volume confirmed the pattern. Patterns with below-average volume score lower and are filtered more aggressively by the threshold.
Indicator Limitations
Pattern detection is geometric — it identifies shape, not causation. Many valid-geometry patterns will fail in context
In ranging markets, engulfing patterns and pin bars fire frequently with no follow-through
The strength score is a heuristic composite, not a statistically back-tested predictor
Morning and evening star patterns require three bars and will be labeled on bar three
Originality Statement
The combination of geometric pattern detection with a three-factor composite strength score gating label output is the original contribution of this publication. Most published Pine Script candlestick indicators label every detected pattern geometrically without contextual filtering. The scoring system here — weighting volume deviation, RSI position, and trend alignment simultaneously — is not reproduced from any existing open-source publication.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk. Pattern recognition does not predict future price movement. Use proper risk management at all times.
-Made with passion by jackofalltrades
Pine Script® インジケーター






















