OPEN-SOURCE SCRIPT
更新済 Combined Cluster & Market Structure

I barrowed code from the Mxwll Price Action Suite [Mxwll] script as appreciated the structure in which the script defined structure, however I renamed variables and reduced the original script to define only the outer structure. I added volume and CVD clustering to define ranges and initiation market structures and add the ADX to assist with determining trend strength prior to labeling market structure breaks.
Combined Cluster & Market Structure indicator, a powerful and comprehensive tool for technical analysis. This script integrates two core concepts to provide a holistic view of market dynamics:
Z-Score Clustering & Volume Analysis: The indicator calculates Z-scores for both volume and Cumulative Volume Delta (CVD) to categorize market activity into six distinct clusters:
High-Conviction Bullish/Bearish: Signals of strong directional momentum based on high volume and corresponding CVD.
Effort vs. Result: High volume with moderate CVD, suggesting potential indecision or absorption.
Quiet Accumulation/Distribution: Low-volume periods with strong CVD, often preceding major moves.
Low Conviction/Noise: Represents periods of low market participation and weak signals.
These clusters are visually marked on the chart to provide real-time insight into market sentiment.
Market Structure Mapping: The indicator automatically detects and labels significant structural points to help you navigate price action. It identifies:
Higher Highs (HH) and Lower Lows (LL) to show the primary trend direction.
Breaks of Structure (BoS), indicating trend continuation.
Changes of Character (CHoCH), signaling a potential trend reversal.
Additionally, the script features consolidation box detection, which automatically highlights periods of low-conviction market activity, helping you avoid choppy, sideways markets. An integrated ADX filter ensures that structural breaks are only labeled during periods of strong trend strength, reducing false signals.
I want to thank Mxwll Capital for their contribution to the Combined Cluster & Market Structure indicator.
Combined Cluster & Market Structure indicator, a powerful and comprehensive tool for technical analysis. This script integrates two core concepts to provide a holistic view of market dynamics:
Z-Score Clustering & Volume Analysis: The indicator calculates Z-scores for both volume and Cumulative Volume Delta (CVD) to categorize market activity into six distinct clusters:
High-Conviction Bullish/Bearish: Signals of strong directional momentum based on high volume and corresponding CVD.
Effort vs. Result: High volume with moderate CVD, suggesting potential indecision or absorption.
Quiet Accumulation/Distribution: Low-volume periods with strong CVD, often preceding major moves.
Low Conviction/Noise: Represents periods of low market participation and weak signals.
These clusters are visually marked on the chart to provide real-time insight into market sentiment.
Market Structure Mapping: The indicator automatically detects and labels significant structural points to help you navigate price action. It identifies:
Higher Highs (HH) and Lower Lows (LL) to show the primary trend direction.
Breaks of Structure (BoS), indicating trend continuation.
Changes of Character (CHoCH), signaling a potential trend reversal.
Additionally, the script features consolidation box detection, which automatically highlights periods of low-conviction market activity, helping you avoid choppy, sideways markets. An integrated ADX filter ensures that structural breaks are only labeled during periods of strong trend strength, reducing false signals.
I want to thank Mxwll Capital for their contribution to the Combined Cluster & Market Structure indicator.
リリースノート
Cluster & Market Structure V1.0 (9-Mkt Structure)
The Cluster & Market Structure V1.0 (9-Mkt Structure) indicator is an advanced, multi-faceted tool for identifying and visualizing market state using a combination of Volume and Cumulative Volume Delta (CVD) Z-Score analysis and Traditional Market Structure (Swing Points). The key innovation in this updated version is the expansion of the bar-by-bar classification system from 6 clusters to 9 distinct clusters, offering traders a more nuanced understanding of underlying supply and demand dynamics.
Key Features and Enhancements
1. Enhanced 9-Cluster Market Classification 📊
The indicator classifies each bar into one of nine states by evaluating the Volume Z-Score and CVD Z-Score against their rolling 25
th
and 75
th
percentile thresholds. This creates a 3×3 grid of activity, moving beyond a simple high/low volume dichotomy to include a Moderate Volume category, significantly improving the precision of market-state identification.
Volume Level High CVD (Buying) Moderate CVD (Balanced/Neutral) Low CVD (Selling)
High Volume 1. Extreme Conviction Bullish (Bullish Climax) 3. Effort vs Result/Absorption 2. Extreme Conviction Bearish (Bearish Climax)
Moderate Volume 4. Moderate Accumulation 6. Low Conviction / Noise 5. Moderate Distribution
Low Volume 7. Quiet Accumulation 9. Low Energy / Range-Bound 8. Quiet Distribution
Export to Sheets
Expanded Insight: Clusters 4, 5, and 6 represent market activity with Moderate Volume, which was previously less clearly defined. This allows for the differentiation between low-conviction noise (Cluster 6) and high-conviction moves supported by standard-level flow (Clusters 4 & 5).
Refined Low-Volume States: Clusters 7 and 8 explicitly label periods of Quiet Accumulation and Quiet Distribution, where significant delta occurs on lower-than-average volume, suggesting hidden strength or weakness, respectively.
Consolidation Trigger: The new Cluster 9 (Low Energy / Range-Bound), alongside Cluster 6, now specifically triggers the visualization of Consolidation Boxes, indicating a clear lack of directional conviction and energy.
2. Dynamic Market Structure Mapping 📈
The indicator continues to offer a robust visualization of price action structure, adapted from the standard TradingView/ta/8 library.
Swing Point Identification: Plots Higher Highs (HH), Higher Lows (HL), Lower Highs (LH), and Lower Lows (LL) based on user-defined Pivot Sensitivity.
Structure Breaks: Clearly labels breaks of structure as either Change of Character (CHoCH)—signaling a potential trend reversal—or Break of Structure (BoS)—signaling trend continuation. Users can filter to show 'All,' 'BoS' only, or 'CHoCH' only.
Consolidation Box Plotting: Automatically draws boxes over price action when the bar classification falls into a Low Conviction (6) or Low Energy (9) cluster, highlighting periods of compression and range-bound trading.
3. Core Calculation Methodology
Volume & CVD Z-Scores: Z-Scores for both raw volume and CVD (calculated from a user-defined lower timeframe/anchor via ta.requestVolumeDelta) are computed using a rolling lookback window.
Dynamic Percentile Thresholds: The 25
th
and 75
th
percentiles are calculated from the rolling array of Z-Scores to dynamically define the "High," "Moderate," and "Low" categories for both volume and delta, making the classification relative to recent market conditions.
Rolling Window Management: Arrays are managed to maintain a maximum size defined by the "Cluster Lookback" input (default 40 bars), ensuring the percentile thresholds are based on a statistically relevant, rolling dataset.
The Cluster & Market Structure V1.0 provides a comprehensive foundation for a flow-based, structural analysis, enabling traders to identify and interpret market phases—from climactic exhaustion to quiet accumulation—with high precision.
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。
オープンソーススクリプト
TradingViewの精神に則り、この作者はスクリプトのソースコードを公開しているので、その内容を理解し検証することができます。作者に感謝です!無料でお使いいただけますが、このコードを投稿に再利用する際にはハウスルールに従うものとします。
免責事項
これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。