OPEN-SOURCE SCRIPT
Liquidation Reversal Hunter

## How It Works
### Core Methodology
The indicator uses a multi-factor approach to identify significant price extremes:
#### 1. Volume Analysis (Z-Score Based)
- Calculates the statistical z-score of volume relative to a lookback period
- Identifies volume spikes that are statistically significant
- Scores volume on a scale based on how many standard deviations above average
**Volume Score Breakdown:**
- Extreme volume (3+ standard deviations): 40 points
- Very high volume (2.3+ standard deviations): 32 points
- High volume (1.8+ standard deviations): 24 points
- Above average (2x multiplier): 16 points
#### 2. Price Range Analysis (ATR-Based)
- Compares current candle range to Average True Range (ATR)
- Identifies candles with abnormal price movement
- Contextualizes range within recent volatility
**Range Score Breakdown:**
- Range > 3x ATR: 35 points
- Range > 2.5x ATR: 28 points
- Range > 2x ATR: 21 points
- Range > 1.5x ATR: 14 points
- Range > 1x ATR: 7 points
#### 3. Wick Analysis (Rejection Detection)
- Measures wick size as percentage of total candle range
- Large wicks indicate price rejection at extremes
- Different thresholds for high vs low extremes
**Wick Score Breakdown:**
- Wick > threshold (40% default): 25 points
- Wick > 70% of threshold: 15 points
### Significance Score Calculation
The total significance score (0-100) is calculated by summing:
- Volume component (0-40 points)
- Range component (0-35 points)
- Wick component (0-25 points)
Only price extremes with significance above the user-defined threshold are tracked and displayed.
### Level Tracking and Management
#### Level Creation
When a candle meets the minimum significance threshold:
1. For bearish candles: Level created at the high
2. For bullish candles: Level created at the low
3. Significance score, volume multiple, and timestamp are stored
4. Horizontal line drawn extending into the future
#### Level Lifecycle
- **Active**: Solid line, not yet touched by price
- **Tagged**: Dashed line, price has touched the level
- **Swept**: Line removed, price broke through level
- **Decayed**: Significance reduces over time (0.3% per bar)
- **Removed**: Deleted when too old, swept, or decayed below threshold
#### Smart Features
- **Auto-merge**: Lines within X% of price merge to prevent clutter
- **Max lines**: Limits total lines to prevent chart overload
- **Age decay**: Older lines fade unless highly significant
- **Cleanup**: Proper deletion of old lines and labels
### Signal Generation
#### Signal Strength Calculation (0-10)
Signals are generated based on:
- Volume component (0-3 points)
- Range component (0-2 points)
- Wick rejection (0-2.5 points)
- Significance score (0-2.5 points)
#### Signal Requirements
1. Current candle significance >= minimum threshold
2. Signal strength >= minimum strength setting
3. Optional: Reversal confirmation (configurable)
4. Cooldown period respected (prevents signal spam)
#### Reversal Confirmation (Optional)
When enabled, signals require:
- Low reversal: Previous bars were falling + current bullish candle
- High reversal: Previous bars were rising + current bearish candle
- Number of confirmation bars is user-configurable
## Settings Guide
### Volume Analysis
- **Volume Threshold**: Multiplier above average (default: 2.0x)
- **Volume Lookback**: Period for average calculation (default: 20 bars)
- **Volume Z-Score Threshold**: Statistical significance (default: 1.8)
### Price Range Analysis
- **Wick Size Threshold**: Minimum wick % of range (default: 40%)
- **ATR Length**: Volatility lookback period (default: 14 bars)
### Signal Settings
- **Require Reversal Confirmation**: Wait for reversal pattern (default: ON)
- **Reversal Confirmation Bars**: Bars to confirm (default: 2)
- **Signal Cooldown**: Minimum bars between signals (default: 3)
- **Minimum Signal Strength**: Threshold 1-10 (default: 3)
### Visual Settings
- **Show Significance Lines**: Display horizontal lines (default: ON)
- **Show Line Labels**: Display metrics on lines (default: ON)
- **Label Content**: Significance %, Volume Multiple, or Both
- **Show Reversal Signals**: Display flag markers (default: ON)
- **Show Volume Heatmap**: Background tint for high volume (default: ON)
### Line Management
- **Line Length**: How far lines extend (default: 100 bars)
- **Maximum Line Age**: Remove old lines (default: 100 bars)
- **Minimum Significance**: Filter threshold % (default: 25%)
- **Maximum Active Lines**: Limit clutter (default: 15)
- **Line Merge Threshold**: Auto-merge distance % (default: 0.3%)
- **Base Line Width**: Starting width 1-5 (default: 2)
### Colors
- **High Extreme Color**: Red tones for price highs (default: #FF4757)
- **Low Extreme Color**: Green tones for price lows (default: #00D084)
- **Neutral Color**: Orange for mid-range (default: #FFA502)
- **Line Opacity**: Transparency 0-100 (default: 75)
## How to Use
### Identifying Key Levels
1. Look for horizontal lines on the chart
2. Thicker/brighter lines = higher significance
3. Solid lines = not yet tested
4. Dashed lines = price has touched
### Trading Signals
1. Wait for price to approach a significant level
2. Look for reversal signals (small flags)
3. Confirm with your own analysis
4. Manage risk appropriately
### Volume Context
- Background tint indicates abnormal volume
- Red tint = extreme volume at highs
- Green tint = high volume at lows
- Orange tint = very high volume
### Label Interpretation
Labels show at the end of each line:
- **"75%"** = Significance score
- **"x3.5"** = Volume multiple above average
- **"75% | x3.5"** = Both metrics
## Best Practices
### Timeframe Selection
- **1-5 minute**: Use for scalping, reduce line length to 50
- **15-60 minute**: Good for day trading, default settings work well
- **4H-Daily**: For swing trading, increase line length to 200+
### Avoiding False Signals
1. Use higher minimum significance (40%+)
2. Enable reversal confirmation
3. Increase signal cooldown
4. Use multiple timeframes for confirmation
### Chart Setup
1. Keep chart clean - disable unnecessary features
2. Use appropriate line limits for your timeframe
3. Adjust merge threshold based on asset volatility
4. Consider disabling heatmap if too distracting
## Limitations and Considerations
### What This Indicator Does NOT Do
- Does NOT detect actual liquidations
- Does NOT predict future price movements
- Does NOT guarantee profitable trades
- Does NOT replace proper risk management
### Statistical Nature
- Based on historical price and volume data
- Significance scores are relative to recent history
- Past extremes don't guarantee future reactions
- Market conditions change over time
### Lookahead Bias
- Lines extend into the future from their creation point
- This is NOT lookahead bias - it's forward projection
- Lines are drawn at historical levels and extended
- No future data is used in calculations
## Technical Details
### Calculation Frequency
- All calculations occur on every bar close
- Lines and labels update dynamically
- Age decay applied continuously
- No repainting of historical signals
### Performance
- Optimized array operations
- Automatic cleanup prevents memory bloat
- Efficient sorting for line display
- Suitable for lower timeframes
### Pine Script Version
- Written in Pine Script v6
- Uses arrays for data management
- Line and label objects for visualization
- No external dependencies
## Alert Conditions
Three alert types available:
1. **Low Extreme Reversal Signal**
- Triggered when bullish reversal detected at low extreme
- Message: "Price showing reversal from low extreme with significant volume"
2. **High Extreme Reversal Signal**
- Triggered when bearish reversal detected at high extreme
- Message: "Price showing reversal from high extreme with significant volume"
3. **Significant Price-Volume Extreme**
- Triggered when significance >= 70% with high volume
- Message: "High significance price-volume extreme detected"
## Disclaimer
Trading involves substantial risk of loss. This indicator is for educational and informational purposes only. It is not financial advice and should not be used as the sole basis for trading decisions. Always:
- Use proper risk management
- Confirm signals with multiple analysis methods
- Test on demo accounts before live trading
- Never risk more than you can afford to lose
Past performance of this indicator does not guarantee future results. The indicator identifies historical price-volume patterns, not future price movements.
**Remember**: This tool identifies statistical anomalies in price and volume data. It does not predict the future. Use it as one component of a comprehensive trading strategy.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.