OPEN-SOURCE SCRIPT
Grand Master's Candlestick Dominance (ATR Enhanced)

### Grand Master's Candlestick Dominance (ATR Enhanced)
**Overview**
Unleash the ancient wisdom of Japanese candlestick charting with a modern twist! This comprehensive Pine Script v5 strategy and indicator scans for over 75 classic and advanced candlestick patterns (bullish, bearish, and neutral), assigning dynamic strength scores (1-10) to each for precise signal filtering. Enhanced with Average True Range (ATR) for volatility-aware body size validation, it dominates the markets by combining timeless pattern recognition with robust confirmation layers. Whether used as a backtestable strategy or visual indicator, it empowers traders to spot high-probability reversals, continuations, and indecision setups with surgical accuracy.
Inspired by Steve Nison's *Japanese Candlestick Charting Techniques*, this tool elevates pattern analysis beyond basics—think Hammers, Engulfing patterns, Morning Stars, and rare gems like Abandoned Baby or Concealing Baby Swallow—all consolidated into intelligent arrays for real-time averaging and prioritization.
**Key Features**
- **Extensive Pattern Library**:
- **Bullish (25+ patterns)**: Hammer (8.0), Bullish Engulfing (10.0), Morning Star (7.0), Three White Soldiers (9.0), Dragonfly Doji (8.0), and more (e.g., Rising Three, Unique Three River Bottom).
- **Bearish (25+ patterns)**: Hanging Man (8.0), Bearish Engulfing (10.0), Evening Star (7.0), Three Black Crows (9.0), Gravestone Doji (8.0), and exotics like Upside Gap Two Crows or Stalled Pattern.
- **Neutral/Indecision (34+ patterns)**: Doji variants (Long-Legged, Four Price), Spinning Tops, Harami Crosses, and multi-bar setups like Upside Tasuki Gap or Advancing Block.
Each pattern includes duration tracking (1-5 bars) and ATR-adjusted body/shadow criteria for relevance in volatile conditions.
- **Smart Confirmation Filters** (All Toggleable):
- **Trend Alignment**: 20-period SMA (customizable) ensures entries align with the prevailing trend; optional higher timeframe (e.g., Daily) MA crossover for multi-timeframe confluence.
- **Support/Resistance (S/R)**: Pivot-based levels with 0.01% tolerance to confirm bounces or breaks.
- **Volume Surge**: 20-period volume MA with 1.5x spike multiplier to validate momentum.
- **ATR Body Sizing**: Filters small bodies (<0.3x ATR) and long bodies (>0.8x ATR) for context-aware pattern reliability.
- **Follow-Through**: Ensures post-pattern confirmation via bullish/bearish closes or closes beyond prior bars.
Minimum average strength (default 7.0) and individual pattern thresholds (5.0) prevent weak signals.
- **Entry & Exit Logic**:
- **Long Entry**: Bullish average strength ≥7.0 (outweighing bearish), uptrend, volume spike, near support, follow-through, and HTF alignment.
- **Short Entry**: Mirror for bearish dominance in downtrends near resistance.
- **Exits**: Bearish/neutral shift, or fixed TP (5%) / SL (2%)—pyramiding disabled, 10% equity sizing.
- Backtest range: Jan 1, 2020 – Dec 31, 2025 (editable). Initial capital: $10,000.
- **Interactive Dashboard** (Top-Right Panel):
Real-time insights including:
- Market phase (e.g., "Bullish Phase (Avg Str: 8.2)"), active pattern (e.g., "BULLISH: Bullish Engulfing (Str: 10.0, Bars: 2)"), and trend status.
- Strength breakdowns (Bull/Bear/Neutral counts & averages).
- Filter status (e.g., "Volume: ✔ Spike", "ATR: Enabled (L:0.8, S:0.3)").
- Backtest stats: Total trades, win rate, streak, and last entry/exit details (price & timestamp).
Toggle mode: Strategy (live trades) or Indicator (signals only).
- **Advanced Alerts** (15+ Toggleable Types):
Set up via TradingView's "Any alert() function call" for bar-close triggers:
- Entry/Exit signals with strength & pattern details.
- Strong patterns (≥2 bullish/bearish), neutral indecision, volume spikes.
- S/R breakouts, HTF reversals, high-confidence singles (≥8.0 strength).
- Conflicting signals, MA crossovers, ATR volatility bursts, multi-bar completions.
Example: "STRONG BULLISH PATTERN detected! Strength: 9.5 | Top Pattern: Three White Soldiers | Trend: Up".
**Customization & Usage Tips**
- **Inputs Groups**: Strategy toggles, confirmations, exits, backtest dates, and 15+ alert switches—all intuitively grouped.
- **Optimization**: Tune min strengths for aggressive (lower) or conservative (higher) trading; enable/disable filters to suit your style (e.g., disable S/R for scalping).
- **Best For**: Forex, stocks, crypto on 1H–Daily charts. Test on historical data to refine TP/SL.
- **Limitations**: No external data installs; relies on built-in TA functions. Patterns are probabilistic—combine with your risk management.
Master the candles like a grandmaster. Deploy on TradingView, backtest relentlessly, and let dominance begin! Questions? Drop a comment.
*Version: 1.0 | Updated: September 2025 | Credits: Built on Pine Script v5 with nods to Nison's timeless techniques.*
**Overview**
Unleash the ancient wisdom of Japanese candlestick charting with a modern twist! This comprehensive Pine Script v5 strategy and indicator scans for over 75 classic and advanced candlestick patterns (bullish, bearish, and neutral), assigning dynamic strength scores (1-10) to each for precise signal filtering. Enhanced with Average True Range (ATR) for volatility-aware body size validation, it dominates the markets by combining timeless pattern recognition with robust confirmation layers. Whether used as a backtestable strategy or visual indicator, it empowers traders to spot high-probability reversals, continuations, and indecision setups with surgical accuracy.
Inspired by Steve Nison's *Japanese Candlestick Charting Techniques*, this tool elevates pattern analysis beyond basics—think Hammers, Engulfing patterns, Morning Stars, and rare gems like Abandoned Baby or Concealing Baby Swallow—all consolidated into intelligent arrays for real-time averaging and prioritization.
**Key Features**
- **Extensive Pattern Library**:
- **Bullish (25+ patterns)**: Hammer (8.0), Bullish Engulfing (10.0), Morning Star (7.0), Three White Soldiers (9.0), Dragonfly Doji (8.0), and more (e.g., Rising Three, Unique Three River Bottom).
- **Bearish (25+ patterns)**: Hanging Man (8.0), Bearish Engulfing (10.0), Evening Star (7.0), Three Black Crows (9.0), Gravestone Doji (8.0), and exotics like Upside Gap Two Crows or Stalled Pattern.
- **Neutral/Indecision (34+ patterns)**: Doji variants (Long-Legged, Four Price), Spinning Tops, Harami Crosses, and multi-bar setups like Upside Tasuki Gap or Advancing Block.
Each pattern includes duration tracking (1-5 bars) and ATR-adjusted body/shadow criteria for relevance in volatile conditions.
- **Smart Confirmation Filters** (All Toggleable):
- **Trend Alignment**: 20-period SMA (customizable) ensures entries align with the prevailing trend; optional higher timeframe (e.g., Daily) MA crossover for multi-timeframe confluence.
- **Support/Resistance (S/R)**: Pivot-based levels with 0.01% tolerance to confirm bounces or breaks.
- **Volume Surge**: 20-period volume MA with 1.5x spike multiplier to validate momentum.
- **ATR Body Sizing**: Filters small bodies (<0.3x ATR) and long bodies (>0.8x ATR) for context-aware pattern reliability.
- **Follow-Through**: Ensures post-pattern confirmation via bullish/bearish closes or closes beyond prior bars.
Minimum average strength (default 7.0) and individual pattern thresholds (5.0) prevent weak signals.
- **Entry & Exit Logic**:
- **Long Entry**: Bullish average strength ≥7.0 (outweighing bearish), uptrend, volume spike, near support, follow-through, and HTF alignment.
- **Short Entry**: Mirror for bearish dominance in downtrends near resistance.
- **Exits**: Bearish/neutral shift, or fixed TP (5%) / SL (2%)—pyramiding disabled, 10% equity sizing.
- Backtest range: Jan 1, 2020 – Dec 31, 2025 (editable). Initial capital: $10,000.
- **Interactive Dashboard** (Top-Right Panel):
Real-time insights including:
- Market phase (e.g., "Bullish Phase (Avg Str: 8.2)"), active pattern (e.g., "BULLISH: Bullish Engulfing (Str: 10.0, Bars: 2)"), and trend status.
- Strength breakdowns (Bull/Bear/Neutral counts & averages).
- Filter status (e.g., "Volume: ✔ Spike", "ATR: Enabled (L:0.8, S:0.3)").
- Backtest stats: Total trades, win rate, streak, and last entry/exit details (price & timestamp).
Toggle mode: Strategy (live trades) or Indicator (signals only).
- **Advanced Alerts** (15+ Toggleable Types):
Set up via TradingView's "Any alert() function call" for bar-close triggers:
- Entry/Exit signals with strength & pattern details.
- Strong patterns (≥2 bullish/bearish), neutral indecision, volume spikes.
- S/R breakouts, HTF reversals, high-confidence singles (≥8.0 strength).
- Conflicting signals, MA crossovers, ATR volatility bursts, multi-bar completions.
Example: "STRONG BULLISH PATTERN detected! Strength: 9.5 | Top Pattern: Three White Soldiers | Trend: Up".
**Customization & Usage Tips**
- **Inputs Groups**: Strategy toggles, confirmations, exits, backtest dates, and 15+ alert switches—all intuitively grouped.
- **Optimization**: Tune min strengths for aggressive (lower) or conservative (higher) trading; enable/disable filters to suit your style (e.g., disable S/R for scalping).
- **Best For**: Forex, stocks, crypto on 1H–Daily charts. Test on historical data to refine TP/SL.
- **Limitations**: No external data installs; relies on built-in TA functions. Patterns are probabilistic—combine with your risk management.
Master the candles like a grandmaster. Deploy on TradingView, backtest relentlessly, and let dominance begin! Questions? Drop a comment.
*Version: 1.0 | Updated: September 2025 | Credits: Built on Pine Script v5 with nods to Nison's timeless techniques.*
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.