OPEN-SOURCE SCRIPT
Real-Time Spring Detector

This is a Pine Script for Trading View that creates a "Real-Time Spring Detector" indicator. This Pine Script is essentially a sophisticated pattern recognition tool that helps identify "spring" setups - a popular trading pattern where price briefly breaks below support but then bounces back strongly, often indicating that sellers are exhausted and buyers are ready to step in.What is a "Spring" in Trading?
A spring is a technical analysis pattern that occurs when:
Price breaks below a support level (like breaking below a floor)
But then quickly bounces back up (like a spring rebounds)
This often signals that sellers are weak and buyers are stepping in
Think of it like testing the strength of a trampoline - you push down, but it springs back up stronger.
What This Script Does
This Pine Script automatically detects spring patterns on your chart and alerts you when they happen. Here's how it works:
Main Components
1. Input Parameters (Settings You Can Adjust)
Lookback Period (10): How many bars back to look for patterns
Min Support Touches (2): How many times price must touch the support level
Min Penetration % (0.1%): How far below support price must break
Min Rejection % (30%): How much price must bounce back up
Alert Settings: Choose when to get notifications
2. Support Level Detection
The script finds "support levels" - price levels where buyers have stepped in before:
It looks at recent low points
Identifies areas where price has bounced multiple times
Uses a small tolerance (0.5%) to account for minor price differences
3. Spring Detection Logic
The script identifies three types of springs:
Real-Time Spring (happening right now):
Price breaks below support by the minimum amount
Price bounces back strongly (rejection %)
Current candle closes higher than it opened (bullish)
Volume is reasonable
Confirmed Spring (already completed):
Same as real-time, but the candle has finished forming
Potential Spring (early warning):
Price is near support but hasn't fully formed the pattern yet
4. Visual Elements
Markers on Chart:
🟢 Green Triangle: Confirmed spring (reliable signal)
🟡 Yellow Triangle: Spring forming right now (live signal)
🟠 Orange Circle: Potential spring (early warning)
Labels:
Show "SPRING" with the rejection percentage
"FORMING" for developing patterns
"?" for potential springs
Support Line:
Red dotted line showing the support level
Background Colors:
Light red when price penetrates support
Light yellow for potential springs
5. Information Box
A table in the top-left corner shows:
Current support level price
Whether penetration is happening
Rejection percentage
Current pattern status
Live price
6. Alert System
Two types of alerts:
Real-time alerts: Notify when spring is forming (current bar)
Confirmed alerts: Notify when spring is complete (bar closed)
Alert cooldown: Prevents spam by waiting 5 bars between alerts
How to Use This Script
1. Installation
Copy the script code
Open TradingView
Go to Pine Editor
Paste the code
Click "Add to Chart"
2. Settings
Adjust the input parameters based on your trading style:
Lower lookback = more sensitive, faster signals
Higher support touches = more reliable but fewer signals
Lower penetration % = catches smaller springs
Higher rejection % = only strong bounces
3. Interpretation
Green triangles: High-confidence buy signals
Yellow triangles: Watch closely, pattern developing
Orange circles: Early warning, not tradeable yet
4. Best Practices
Use on higher timeframes (15min+) for more reliable signals
Combine with other indicators for confirmation
Pay attention to volume - higher volume springs are more reliable
Wait for confirmed signals if you're a conservative trader
Key Features for Small Timeframes
The script includes special detection for shorter timeframes:
Quick bounce detection: Identifies rapid reversals
Hammer pattern recognition: Spots candlestick patterns
Relaxed volume requirements: Works when volume data is limited
Advanced Features
Volume Analysis
Compares current volume to 10-bar average
Requires at least 80% of average volume (flexible for small timeframes)
Pattern Enhancement
Looks for hammer-like candles (long lower wick, small upper wick)
Identifies quick bounces where the upper wick is small
Multiple Confirmation
Combines multiple criteria to reduce false signals
Stronger springs get priority for alerts
Common Use Cases
Entry Signals: Buy when confirmed springs appear
Support Level Identification: Visual support lines help identify key levels
Risk Management: Failed springs (continued breakdown) can be stop-loss triggers
Market Structure: Understanding where buyers are defending price levels
Limitations
Works best in trending or ranging markets May produce false signals in very choppy conditions
small timeframe signals can be noisy should be combined with other analysis methods.The key advantage is that it can catch these patterns as they happen, rather than you having to constantly watch charts. This is especially valuable for active traders who want to capitalize on quick reversals at support levels.
A spring is a technical analysis pattern that occurs when:
Price breaks below a support level (like breaking below a floor)
But then quickly bounces back up (like a spring rebounds)
This often signals that sellers are weak and buyers are stepping in
Think of it like testing the strength of a trampoline - you push down, but it springs back up stronger.
What This Script Does
This Pine Script automatically detects spring patterns on your chart and alerts you when they happen. Here's how it works:
Main Components
1. Input Parameters (Settings You Can Adjust)
Lookback Period (10): How many bars back to look for patterns
Min Support Touches (2): How many times price must touch the support level
Min Penetration % (0.1%): How far below support price must break
Min Rejection % (30%): How much price must bounce back up
Alert Settings: Choose when to get notifications
2. Support Level Detection
The script finds "support levels" - price levels where buyers have stepped in before:
It looks at recent low points
Identifies areas where price has bounced multiple times
Uses a small tolerance (0.5%) to account for minor price differences
3. Spring Detection Logic
The script identifies three types of springs:
Real-Time Spring (happening right now):
Price breaks below support by the minimum amount
Price bounces back strongly (rejection %)
Current candle closes higher than it opened (bullish)
Volume is reasonable
Confirmed Spring (already completed):
Same as real-time, but the candle has finished forming
Potential Spring (early warning):
Price is near support but hasn't fully formed the pattern yet
4. Visual Elements
Markers on Chart:
🟢 Green Triangle: Confirmed spring (reliable signal)
🟡 Yellow Triangle: Spring forming right now (live signal)
🟠 Orange Circle: Potential spring (early warning)
Labels:
Show "SPRING" with the rejection percentage
"FORMING" for developing patterns
"?" for potential springs
Support Line:
Red dotted line showing the support level
Background Colors:
Light red when price penetrates support
Light yellow for potential springs
5. Information Box
A table in the top-left corner shows:
Current support level price
Whether penetration is happening
Rejection percentage
Current pattern status
Live price
6. Alert System
Two types of alerts:
Real-time alerts: Notify when spring is forming (current bar)
Confirmed alerts: Notify when spring is complete (bar closed)
Alert cooldown: Prevents spam by waiting 5 bars between alerts
How to Use This Script
1. Installation
Copy the script code
Open TradingView
Go to Pine Editor
Paste the code
Click "Add to Chart"
2. Settings
Adjust the input parameters based on your trading style:
Lower lookback = more sensitive, faster signals
Higher support touches = more reliable but fewer signals
Lower penetration % = catches smaller springs
Higher rejection % = only strong bounces
3. Interpretation
Green triangles: High-confidence buy signals
Yellow triangles: Watch closely, pattern developing
Orange circles: Early warning, not tradeable yet
4. Best Practices
Use on higher timeframes (15min+) for more reliable signals
Combine with other indicators for confirmation
Pay attention to volume - higher volume springs are more reliable
Wait for confirmed signals if you're a conservative trader
Key Features for Small Timeframes
The script includes special detection for shorter timeframes:
Quick bounce detection: Identifies rapid reversals
Hammer pattern recognition: Spots candlestick patterns
Relaxed volume requirements: Works when volume data is limited
Advanced Features
Volume Analysis
Compares current volume to 10-bar average
Requires at least 80% of average volume (flexible for small timeframes)
Pattern Enhancement
Looks for hammer-like candles (long lower wick, small upper wick)
Identifies quick bounces where the upper wick is small
Multiple Confirmation
Combines multiple criteria to reduce false signals
Stronger springs get priority for alerts
Common Use Cases
Entry Signals: Buy when confirmed springs appear
Support Level Identification: Visual support lines help identify key levels
Risk Management: Failed springs (continued breakdown) can be stop-loss triggers
Market Structure: Understanding where buyers are defending price levels
Limitations
Works best in trending or ranging markets May produce false signals in very choppy conditions
small timeframe signals can be noisy should be combined with other analysis methods.The key advantage is that it can catch these patterns as they happen, rather than you having to constantly watch charts. This is especially valuable for active traders who want to capitalize on quick reversals at support levels.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。