OPEN-SOURCE SCRIPT
MA Phase Visualizer

🔹 Logic
This indicator classifies market conditions into six phases based on the relative ordering (rank structure) of three moving averages: Short, Mid, and Long.
All possible permutations of these three moving averages are mapped into background colors, allowing the current structural state of the market to be visualized in real time directly on the chart.
🔹 Phase Definitions
Phases are defined by the relative positioning of the moving averages (Short: S, Mid: M, Long: L):
Phase 1 (Red): S > M > L
Phase 2 (Orange): M > S > L
Phase 3 (Yellow): M > L > S
Phase 4 (Green): L > M > S
Phase 5 (Blue): L > S > M
Phase 6 (Purple): S > L > M
💻 Key Features
1. MA Options
Supports five types of moving averages: SMA, EMA, RMA, WMA, and VWMA, allowing flexible adaptation to different trading styles.
2. Mapping
Each phase is mapped to a distinct background color, enabling intuitive identification of the current market structure.
3. Structural Persistence Tracking
Allows users to visually assess how long a given structural arrangement persists over time.
4. Visual Optimization
Adjustable background transparency (bgAlpha) for improved readability and integration with other chart elements.
💡 Interpretation Guide
1. Trending Market
When Phase 1 (uptrend) or Phase 4 (downtrend) persists over an extended period,
the market can be interpreted as being in a structurally stable trending condition.
2. Structural Transitions
Transitions from Phase 1 or 4 into Phase 2 or 5 represent temporary structural shifts.
Monitoring whether the structure returns to the original phase or progresses into a different phase provides insight into trend continuation or breakdown.
3. Ranging Market (Sideways Condition)
When Phase 1 and 4 appear briefly while Phases 2, 3, 5, and 6 alternate frequently over short intervals, the moving averages are converging, indicating a loss of directional structure and a ranging (sideways) market.
⚠️ Notes
This indicator is designed to visualize market structure through moving average ordering.
It classifies the current market state into one of six structural phases based on the relative position of the Short, Mid, and Long moving averages.
The indicator is intended to support market condition analysis and structural interpretation.
For clarity, the three moving averages used in phase classification are displayed on the chart.
This indicator classifies market conditions into six phases based on the relative ordering (rank structure) of three moving averages: Short, Mid, and Long.
All possible permutations of these three moving averages are mapped into background colors, allowing the current structural state of the market to be visualized in real time directly on the chart.
🔹 Phase Definitions
Phases are defined by the relative positioning of the moving averages (Short: S, Mid: M, Long: L):
Phase 1 (Red): S > M > L
Phase 2 (Orange): M > S > L
Phase 3 (Yellow): M > L > S
Phase 4 (Green): L > M > S
Phase 5 (Blue): L > S > M
Phase 6 (Purple): S > L > M
💻 Key Features
1. MA Options
Supports five types of moving averages: SMA, EMA, RMA, WMA, and VWMA, allowing flexible adaptation to different trading styles.
2. Mapping
Each phase is mapped to a distinct background color, enabling intuitive identification of the current market structure.
3. Structural Persistence Tracking
Allows users to visually assess how long a given structural arrangement persists over time.
4. Visual Optimization
Adjustable background transparency (bgAlpha) for improved readability and integration with other chart elements.
💡 Interpretation Guide
1. Trending Market
When Phase 1 (uptrend) or Phase 4 (downtrend) persists over an extended period,
the market can be interpreted as being in a structurally stable trending condition.
2. Structural Transitions
Transitions from Phase 1 or 4 into Phase 2 or 5 represent temporary structural shifts.
Monitoring whether the structure returns to the original phase or progresses into a different phase provides insight into trend continuation or breakdown.
3. Ranging Market (Sideways Condition)
When Phase 1 and 4 appear briefly while Phases 2, 3, 5, and 6 alternate frequently over short intervals, the moving averages are converging, indicating a loss of directional structure and a ranging (sideways) market.
⚠️ Notes
This indicator is designed to visualize market structure through moving average ordering.
It classifies the current market state into one of six structural phases based on the relative position of the Short, Mid, and Long moving averages.
The indicator is intended to support market condition analysis and structural interpretation.
For clarity, the three moving averages used in phase classification are displayed on the chart.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.