OPEN-SOURCE SCRIPT

Hammer + Spring Confluence Detector

631
Hammer + Spring Confluence Detector - Complete Analysis
Overview
This Pine Script indicator is designed to identify high-probability bullish reversal opportunities by detecting the confluence of two powerful patterns: Hammer candlesticks and Spring patterns. When these patterns occur simultaneously, they create a strong buying signal with multiple confirmations.

How the Script Works
1. Trend Detection System
The script first establishes market context using three options:

SMA50: Uses 50-period moving average to determine trend direction
SMA50 + SMA200: Uses both averages for more robust trend identification
No detection: Ignores trend context

Logic:

Downtrend = Price below SMA50 (and SMA50 below SMA200 if using dual SMA)
This ensures hammer patterns are detected only in appropriate market conditions

2. Hammer Pattern Detection
Basic Hammer Criteria:

Small body: Body size < EMA of recent body sizes
Body position: Body located in upper half of the candle range
Long lower shadow: Lower shadow ≥ 2x the body size (configurable factor)
Short upper shadow: Upper shadow ≤ 50% of body size

Enhanced Confirmations:
The script adds multiple confirmation layers:

Volume confirmation: Volume > 1.2x average (configurable)
RSI oversold: RSI < 35 (indicating oversold conditions)
Trend alignment: Occurs during established downtrend

Scoring System: Assigns points for each confirmation, requiring ≥2 points for "Hammer at "
3. Spring Pattern Detection
Level Calculation:
- Analyzes last 10 bars (configurable lookback)
- Identifies price levels touched multiple times (min 2 touches)
- Uses 0.5% tolerance for level identification
- Falls back to lowest low if insufficient touches found
Spring Criteria:

Penetration: Price breaks below by minimum % (default 0.1%)
Rejection: Strong bounce showing ≥30% rejection of the range
Bullish close: Candle closes above its open
Volume: Adequate volume (≥80% of 10-period average)

Advanced Spring Validation:

Quick bounce: High-close distance < 50% of close-low distance
Hammer-like structure: Close-low ≥ 60% of total range

4. Confluence Detection
The magic happens when both patterns align:
Standard Confluence:

Hammer pattern + Spring pattern occurring simultaneously
Creates "H+S" label with rejection percentage

High-Quality Confluence (★ STRONG BUY ★):

Enhanced hammer at level
Confirmed spring pattern
Volume spike present
RSI oversold condition
Additional rejection strength (≥50%)


Visual Elements
Labels and Markers:

Blue "H": Individual hammer patterns
Green "S": Individual spring patterns
Red "H+S": Confirmed confluence with rejection %
Yellow "Hammer+Spring FORMING": Real-time forming patterns
Purple "★ STRONG BUY ★": High-quality confluence signals

Additional Visuals:

lines: Dotted red lines showing identified levels
Background highlighting:

Purple for high-quality confluence
Red for standard confluence
Orange for penetration


Triangle markers: Below-bar confirmation signals

Information Table:
Real-time status display showing:

Hammer status (No/Yes/Strong)
Spring status (No/Forming/Confirmed)
Current level
Rejection percentage
Volume condition
RSI status
Overall confluence status


Effectiveness for Traders
✅ Strengths:
1. Multiple Confirmation System

Combines price action, volume, momentum (RSI), and levels
Reduces false signals through layered validation
Different confidence levels (standard vs. high-quality signals)

2. Risk Management Features

Alert cooldown prevents spam (5-bar default)
Clear levels for stop-loss placement
Visual cues for different signal strengths

3. Flexibility

Configurable parameters for different markets/timeframes
Optional trend filtering
Real-time and confirmed signal options

4. Comprehensive Information

Detailed status table for decision-making
Rejection percentages for signal strength assessment
Multiple alert types for different trading styles

⚠️ Limitations:
1. Lagging Nature

Requires pattern completion for confirmation
May miss early entry opportunities
Best signals come after significant price movement

2. Market Dependency

More effective in trending markets with clear levels
May generate false signals in choppy/sideways markets
Requires adequate volume for reliable signals

3. Parameter Sensitivity

Multiple configurable parameters may require optimization
Settings may need adjustment for different instruments
Over-optimization risk in backtesting

📊 Trading Effectiveness:
High Probability Scenarios:

Score: 8-9/10 for high-quality confluence signals
Strong levels with multiple touches
Clear downtrend with oversold RSI
Volume spike confirmation
Clean hammer formation with strong rejection

Moderate Probability Scenarios:

Score: 6-7/10 for standard confluence
Adequate volume without spike
Normal RSI levels
Less defined levels

Risk Factors:

False breakouts below
Low volume environments
Conflicting higher timeframe trends
News-driven volatility


Optimal Usage Guidelines
Best Timeframes:

Daily charts: Most reliable for swing trading
4H charts: Good balance of signals and reliability
1H charts: More signals but requires careful filtering

Recommended Settings:

Use trend detection (SMA50 + SMA200) for better context
Keep default volume threshold (1.2x)
Adjust RSI oversold level based on market volatility
Enable both real-time and confirmed alerts

Entry Strategy:

Wait for high-quality confluence confirmation
Enter on break above hammer high or next candle open
Set stop-loss below identified level
Target 2-3x risk-reward ratio

Risk Management:

Never risk more than 1-2% per trade
Use position sizing based on stop-loss distance
Consider overall market conditions and higher timeframe trends
Combine with other technical analysis tools for confirmation


Conclusion
This indicator represents a sophisticated approach to reversal trading, combining classical candlestick patterns with /resistance analysis. Its effectiveness lies in the multi-layered confirmation system that filters out many false signals common with single-pattern approaches.
For experienced traders: This tool can significantly improve entry timing and signal quality when used as part of a comprehensive trading strategy.
The complexity might be overwhelming, but the clear visual cues and information table make it educational for learning pattern recognition.
Enjoy!!

Exención de responsabilidad

La información y las publicaciones que ofrecemos, no implican ni constituyen un asesoramiento financiero, ni de inversión, trading o cualquier otro tipo de consejo o recomendación emitida o respaldada por TradingView. Puede obtener información adicional en las Condiciones de uso.