OPEN-SOURCE SCRIPT
Accordion Index (Swing-Based) Structural Market Regime Analysis

The Accordion Index is a multi-dimensional market structure indicator designed to diagnose regime formation, expansion, compression, and transition phases across financial markets. Rather than generating isolated buy/sell signals, it provides contextual insight into how price, structure, and participation interact over time.
The indicator is based on a swing-based, multi-leg framework, which reflects how markets naturally alternate between expansion, correction, re-expansion, and resolution phases. These repeating swing sequences form the foundation of both classical cycle analysis and Elliott Wave structures.
By quantifying the internal quality of these swing structures, the Accordion Index evaluates whether price movements are structurally aligned, directionally efficient, and institutionally supported.
Core Components
The indicator consists of three complementary components:
1) Accordion Correlation (Blue Line) Structural Alignment
Measures the degree of synchronization between short-term swing behavior and the dominant higher-timeframe regime.
Rising values indicate increasing structural coherence.
Declining values reflect regime decay and fractal misalignment.
This component highlights whether market movements are organized within a broader cycle structure or fragmented across timeframes.
2) Efficiency (Green Line) Directional Progress
Measures how much net directional displacement price achieves relative to its internal movement.
Rising values indicate clean, trend-supportive movement.
Falling values reflect consolidation, churn, or distribution.
This component distinguishes productive trends from sideways or internally conflicted phases.
3) Average Swing Speed (Red Line) Participation and Energy
Measures the velocity and urgency of swing movements.
Rising values indicate strong institutional and speculative engagement.
Declining values suggest fading participation or exhaustion.
This component reflects whether major capital is actively sponsoring price movement.
Regime Thresholds
Two reference levels provide structural context:
Directional Regime (+0.5, Blue Dashed Line)
Identifies mature directional regimes with strong structural coherence, typically associated with sustained trend phases.
Strong Accordion (–0.5, Purple Dashed Line)
Marks extreme structural dislocation, often occurring during crisis periods, panic phases, or major regime breakdowns.
Interpreting the Accordion Index
The indicator should be interpreted as a regime and structure filter rather than a standalone signal generator.
Typical configurations include:
Rising correlation, rising efficiency, rising speed
=Trend expansion and regime confirmation
Rising correlation, falling efficiency, elevated speed
=Compression and accumulation/distribution
Falling correlation and efficiency with unstable speed
=Regime decay and transition
Simultaneous recovery in correlation and efficiency
=Structural re-synchronization and trend re-emergence
These configurations allow traders to assess whether markets are trending, consolidating, transitioning, or reorganizing internally.
Market-Agnostic and Fractal Design
The Accordion Index is market-agnostic and fractal in nature. It can be applied to:
FX, commodities, indices, equities, and crypto
Intraday, swing, and long-term timeframes
The underlying swing structure exists in all sufficiently liquid markets. Differences in behavior are reflected through changes in structural coherence, efficiency, and participation rather than through pattern distortion.
The indicator therefore adapts naturally to different asset classes and volatility regimes.
Integration with Cycle and Wave Analysis
The Accordion Index is designed to complement, not replace, existing analytical frameworks.
Cycle Analysis
It can be used to validate cycle phases by confirming whether internal structure supports expansion, compression, or transition scenarios.
Elliott Wave Analysis
The indicator aligns naturally with Elliott Wave principles by evaluating the quality of impulsive and corrective phases:
Impulsive waves typically show rising correlation, efficiency, and speed.
Corrective waves tend to display falling efficiency and structural fragmentation.
Wave extensions and failures are often preceded by changes in internal alignment.
This makes the Accordion Index a valuable supplemental tool for confirming wave counts and identifying regime exhaustion or re-synchronization.
Practical Usage
The Accordion Index functions best as a contextual filter:
High structural alignment = trust trend structure
Low efficiency = expect consolidation
Low participation = avoid forcing trades
Trades and projections should be executed in alignment with prevailing structural conditions rather than isolated price patterns.
Disclaimer
This indicator is intended for educational and analytical purposes. It does not constitute financial advice. All trading decisions remain the responsibility of the user.
Closing Note
The Accordion Index is designed to visualize how markets organize, exhaust, compress, and re-synchronize over time. By integrating structural alignment, directional efficiency, and participation dynamics, it provides a unified framework for understanding market regimes across asset classes and timeframes.
The indicator is based on a swing-based, multi-leg framework, which reflects how markets naturally alternate between expansion, correction, re-expansion, and resolution phases. These repeating swing sequences form the foundation of both classical cycle analysis and Elliott Wave structures.
By quantifying the internal quality of these swing structures, the Accordion Index evaluates whether price movements are structurally aligned, directionally efficient, and institutionally supported.
Core Components
The indicator consists of three complementary components:
1) Accordion Correlation (Blue Line) Structural Alignment
Measures the degree of synchronization between short-term swing behavior and the dominant higher-timeframe regime.
Rising values indicate increasing structural coherence.
Declining values reflect regime decay and fractal misalignment.
This component highlights whether market movements are organized within a broader cycle structure or fragmented across timeframes.
2) Efficiency (Green Line) Directional Progress
Measures how much net directional displacement price achieves relative to its internal movement.
Rising values indicate clean, trend-supportive movement.
Falling values reflect consolidation, churn, or distribution.
This component distinguishes productive trends from sideways or internally conflicted phases.
3) Average Swing Speed (Red Line) Participation and Energy
Measures the velocity and urgency of swing movements.
Rising values indicate strong institutional and speculative engagement.
Declining values suggest fading participation or exhaustion.
This component reflects whether major capital is actively sponsoring price movement.
Regime Thresholds
Two reference levels provide structural context:
Directional Regime (+0.5, Blue Dashed Line)
Identifies mature directional regimes with strong structural coherence, typically associated with sustained trend phases.
Strong Accordion (–0.5, Purple Dashed Line)
Marks extreme structural dislocation, often occurring during crisis periods, panic phases, or major regime breakdowns.
Interpreting the Accordion Index
The indicator should be interpreted as a regime and structure filter rather than a standalone signal generator.
Typical configurations include:
Rising correlation, rising efficiency, rising speed
=Trend expansion and regime confirmation
Rising correlation, falling efficiency, elevated speed
=Compression and accumulation/distribution
Falling correlation and efficiency with unstable speed
=Regime decay and transition
Simultaneous recovery in correlation and efficiency
=Structural re-synchronization and trend re-emergence
These configurations allow traders to assess whether markets are trending, consolidating, transitioning, or reorganizing internally.
Market-Agnostic and Fractal Design
The Accordion Index is market-agnostic and fractal in nature. It can be applied to:
FX, commodities, indices, equities, and crypto
Intraday, swing, and long-term timeframes
The underlying swing structure exists in all sufficiently liquid markets. Differences in behavior are reflected through changes in structural coherence, efficiency, and participation rather than through pattern distortion.
The indicator therefore adapts naturally to different asset classes and volatility regimes.
Integration with Cycle and Wave Analysis
The Accordion Index is designed to complement, not replace, existing analytical frameworks.
Cycle Analysis
It can be used to validate cycle phases by confirming whether internal structure supports expansion, compression, or transition scenarios.
Elliott Wave Analysis
The indicator aligns naturally with Elliott Wave principles by evaluating the quality of impulsive and corrective phases:
Impulsive waves typically show rising correlation, efficiency, and speed.
Corrective waves tend to display falling efficiency and structural fragmentation.
Wave extensions and failures are often preceded by changes in internal alignment.
This makes the Accordion Index a valuable supplemental tool for confirming wave counts and identifying regime exhaustion or re-synchronization.
Practical Usage
The Accordion Index functions best as a contextual filter:
High structural alignment = trust trend structure
Low efficiency = expect consolidation
Low participation = avoid forcing trades
Trades and projections should be executed in alignment with prevailing structural conditions rather than isolated price patterns.
Disclaimer
This indicator is intended for educational and analytical purposes. It does not constitute financial advice. All trading decisions remain the responsibility of the user.
Closing Note
The Accordion Index is designed to visualize how markets organize, exhaust, compress, and re-synchronize over time. By integrating structural alignment, directional efficiency, and participation dynamics, it provides a unified framework for understanding market regimes across asset classes and timeframes.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。