PROTECTED SOURCE SCRIPT
Diupdate Daily POC Lines - Clustered

Overview
This indicator automatically plots horizontal lines at the Point of Control (POC) for each daily candle, intelligently clustering nearby levels to reduce visual noise and highlight the most significant price zones where volume concentration occurred.
What Makes This Original
Unlike standard volume profile indicators that show static profiles for the entire chart, this script:
Calculates individual POC levels for each daily candle within a user-defined lookback period
Implements an intelligent clustering algorithm that merges POC levels within a customizable percentage threshold, preventing chart clutter from redundant lines
Dynamically highlights high-significance clusters (multiple days sharing the same POC level) with customizable visual styling
Provides granular control over line extension, label positioning, and visual appearance
How It Works
The script divides each daily candle's price range into configurable bins (default 20) and distributes the day's volume across these levels to approximate the POC. When multiple days produce POC levels within the specified clustering threshold (default 2%), they merge into a single line with a counter showing how many days share that level.
Key Features
Adjustable lookback period (1-500 candles)
Intelligent clustering with customizable threshold percentage
Separate styling controls for regular POCs vs. high-count clusters
Toggle visibility for lines and labels independently
Configurable line colors, widths, styles (solid/dashed/dotted), and extension
Date labels with cluster count indicators
Adjustable label positioning and offset
Use Cases
Traders can use clustered POC levels to:
Identify key support and resistance zones based on historical volume concentration
Recognize high-significance price levels where multiple days' POCs converge
Reduce chart clutter while maintaining visibility of important volume-based levels
Combine with other technical analysis methods for confluence
Settings
The indicator organizes inputs into four logical groups:
General Settings - Lookback period, cluster threshold, volume bins
Line Settings - Visibility, color, width, style, and extension options
Label Settings - Visibility, position, offset, and color
Cluster Highlights - Threshold and custom styling for high-count clusters
Important Notes
This script uses an approximation method for POC calculation by dividing each candle's range into bins. For maximum accuracy, use on daily timeframe charts. The clustering feature is particularly useful when analyzing longer lookback periods where many POC levels may naturally converge around similar price zones.
Technical Details
Written in Pine Script v5
Maximum 500 lines on chart
Requests daily timeframe data using security function
Uses arrays to store and manage POC data efficiently
Redraws all lines on the last bar for optimal performance
Catatan Rilis
Fixed lines extended into infinity on the right side of the chart.Catatan Rilis
🎯 New FeaturesMulti-Timeframe SupportAdded timeframe selector in General Settings (default: Daily)
Calculate POCs from ANY timeframe while viewing a different chart interval
Example: View 15-minute chart with Daily POCs, or 1-hour chart with Weekly POCs
Perfect for intraday traders who want to see higher timeframe volume levels
Untested POC Highlighting
New detection system identifies POC levels that haven't been touched recently
Configurable "untested period" threshold (default: 50 bars)
Separate color coding for untested lines and labels (default: yellow)
Full style customization: colors, line width, and label size
Priority system: Untested > Clustered > Normal styling
Price Display on Labels
Toggle to show/hide price values directly on labels
Format: Price | Date (Count)
Uses proper tick formatting for each instrument
Helps quickly identify price levels without hovering
🔧 Major ImprovementsFixed Cluster Count Accuracy
CRITICAL FIX: Cluster counts now accurately reflect the lookback period
Previously, counts could exceed lookback window due to accumulated old data
Now properly tracks first and last dates for each cluster
Old clusters outside lookback period are automatically cleaned up
Example: With 200-bar lookback, you'll never see "(250x)" anymore
Better Data Structure
Replaced complex nested arrays with efficient parallel arrays
Improved performance and Pine Script compatibility
Tracks: prices, first date, last date, count, and last touch per cluster
Extended Line Control
"Extend Lines Left" toggle now works correctly
Lines stop at current candle (no unwanted right extension)
When enabled, lines extend infinitely to the left for historical context
🎨 UI/UX ImprovementsOrganized Settings Layout
Settings grouped into 5 logical sections:
General Settings (timeframe, lookback, clustering)
Line Settings (visibility, colors, styles, extension)
Label Settings (visibility, position, price display)
Cluster Highlights (high-count cluster styling)
Untested POCs (NEW - untested level detection & styling)
🐛 Bug Fixes
Fixed array out-of-bounds errors on early bars
Fixed line extension behavior (no more unwanted right extension)
Fixed cluster count inflation beyond lookback period
Added safety checks for empty arrays throughout
Catatan Rilis
Daily POC Lines - Clustered v2.0 - Patch Notes🎉 Major Features
Multi-Line Label System
New Toggle: "Multi-Line Labels" - Switch between compact single-line and detailed multi-line format
Multi-line format shows:
Price: The averaged POC level
Dates: Up to 5 most recent dates when POCs were added (e.g., "11/15, 11/18, 11/22, 11/25, 11/28")
POCs: Count of merged POCs in this cluster
⚠ UNTESTED warning when price hasn't revisited the level
Why this matters: See when price repeatedly returned to a level, revealing patterns like weekly cycles or event-driven behavior
Individual Label Element Toggles
New granular controls in Label Settings:
☑️ Show Price - Toggle price display on/off
☑️ Show Dates - Toggle date display on/off
☑️ Show POC Count - Toggle count display on/off
☑️ Show Untested Warning - Toggle untested alert on/off
Benefit: Customize labels to your preferred information density - minimal or maximum detail
Comprehensive Tooltip System
Every setting now includes helpful tooltips explaining:
What the setting does
How to use it effectively
Why it matters for trading decisions
Examples:
"Cluster Threshold %: POCs within this percentage of each other will merge into a single cluster. Lower = tighter clustering, Higher = more POCs grouped together"
"Untested Period: A POC is 'untested' if price hasn't touched it in this many bars. Lower = more sensitive, Higher = only very old levels"
🔧 Improvements
Label Settings Reorganization
Renamed "Show Date Labels" → "Show Labels" (clearer purpose)
Added "Label Color" tooltip explaining it's for non-highlighted states
All label toggles now grouped logically in Label Settings
Enhanced Setting Descriptions
"Lookback Candles" now explains that older POCs are removed
"Volume Profile Bins" clarifies precision vs. performance tradeoff
"Extend Lines Left" explains visual difference from default 10-bar display
"Highlight Clusters With" emphasizes that high POC count = strong level
📊 Technical Changes
Date Storage Architecture
Implemented pipe-separated string storage for multiple dates per cluster
Format: "timestamp1|timestamp2|timestamp3"
Dynamically parsed and displayed as formatted dates
Shows up to 5 most recent dates in chronological order
Backwards compatible with existing cluster data
Label Building Logic
Refactored label text generation for modularity
Individual toggles properly respect multi-line vs. single-line format
Untested warning only appears when toggle is enabled
Single-line format maintains original compact appearance
🐛 Bug Fixes
Fixed nested array issue (Pine Script limitation) by using string concatenation
Label element visibility now properly controlled by individual toggles
Multi-line formatting properly handles newlines for each enabled element
📝 Usage Notes
For New Users:
Enable "Multi-Line Labels" to see all available information
Hover over any setting to see detailed tooltips
Start with default settings, then customize based on your chart density preference
For Existing Users:
Multi-line labels are ON by default - toggle off to return to compact format
All existing functionality preserved - this is purely additive
Individual label toggles provide finer control than previous all-or-nothing approach
Recommended Settings for Dense Charts:
Skrip terproteksi
Skrip ini diterbitkan sebagai sumber tertutup. Namun, Anda dapat menggunakannya dengan bebas dan tanpa batasan apa pun – pelajari lebih lanjut di sini.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip terproteksi
Skrip ini diterbitkan sebagai sumber tertutup. Namun, Anda dapat menggunakannya dengan bebas dan tanpa batasan apa pun – pelajari lebih lanjut di sini.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.