OPEN-SOURCE SCRIPT
Price Action & Volume Coherence Analyzer

**Price Action & Volume Coherence Analyzer - Advanced Market Analysis Tool**
This indicator analyzes the relationship between price action and volume, identifying when market movements are efficient or conflicting, helping traders understand the quality of price moves.
**What This Script Does:**
This indicator combines price action analysis with volume coherence detection through a proprietary correlation algorithm:
**1. Price Action Classification System:**
- Analyzes candle body strength (% of range occupied by body)
- Evaluates close position (upper, middle, or lower third of candle)
- Classifies each candle into 4 categories:
- Strong Bullish (large body + close near top + high volume)
- Weak Bullish (small body or close not at top)
- Strong Bearish (large body + close near bottom + high volume)
- Weak Bearish (small body or close not at bottom)
- Optional volume confirmation for enhanced accuracy
**2. Volume-Price Coherence Detection:**
- Compares current volume to historical average
- Compares price range to historical range average
- Calculates coherence ratio: Normalized Range / Normalized Volume
- Identifies market efficiency:
- High coherence (>1.5): Good price movement relative to volume
- Normal coherence (~1.0): Balanced volume-price relationship
- Low coherence (<0.7): Congestion or high volume with little price movement
**3. Visual System:**
- Color-coded candles for instant pattern recognition
- Background highlighting for extreme coherence conditions
- Status bar displaying numerical coherence value
- Alert system for abnormal conditions
**How It Works:**
1. **Candle Analysis**: Evaluates body strength and close position
2. **Volume Analysis**: Normalizes volume against 20-period average
3. **Range Analysis**: Normalizes price range against 20-period average
4. **Coherence Calculation**: Creates ratio revealing volume-price efficiency
5. **Visualization**: Colors candles and background based on conditions
6. **Alerts**: Notifies when coherence becomes extreme
**Key Calculations:**
- Body Ratio = (Candle Body / Candle Range) × 100
- Close Position = (Close - Low) / (High - Low)
- Volume Normalized = Current Volume / Volume Average
- Range Normalized = Current Range / Range Average
- Coherence = Range Normalized / Volume Normalized
**Parameters:**
- **Strong Body Threshold (%)**: Minimum body % to classify candle as strong (default: 60%)
- **Use Volume in Colors**: Enable volume confirmation for classification (default: ON)
- **Average Period**: Lookback period for calculating averages (default: 20)
- **Show Background Alerts**: Highlight extreme coherence on chart (default: ON)
- **Base Equilibrium Value**: Reference point for coherence (default: 1.0)
**Use Cases:**
1. **Traders**: Identify high-quality price moves with adequate volume support
2. **Swing Traders**: Detect reversals when coherence diverges from volume
3. **Scalpers**: Find efficient entry points with strong volume confirmation
4. **Analysts**: Understand market efficiency and trader intent
5. **Risk Managers**: Spot potential manipulation or institutional activity
**Color Coding:**
- **Green Candles**: Strong bullish (large body, close at top)
- **Light Green**: Weak bullish (small body or close not at top)
- **Red Candles**: Strong bearish (large body, close at bottom)
- **Light Red**: Weak bearish (small body or close not at bottom)
- **Gray**: Doji patterns (open = close)
- **Green Background**: Efficient movement (high coherence >1.5)
- **Red Background**: Congestion (low coherence <0.7)
**Originality Statement:**
This script's core algorithm—the volume-price coherence correlation system—is original work. While price action and volume analysis concepts are well-known, this specific implementation that simultaneously evaluates body strength, close position, volume normalization, and range normalization to produce a coherence ratio represents a unique analytical approach not available in standard indicators.
---
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.