OPEN-SOURCE SCRIPT
Heikin-Ashi Trend Matrix [HTM]

Heikin-Ashi Trend Matrix (HTM) uses smoothed Heikin-Ashi calculations combined with a multi-EMA ribbon and ADX filtering to produce a confluence-based scoring system for trend identification and signal generation.

**Mathematical Foundation:**
Heikin-Ashi candles are synthetic candles calculated using averaged formulas: HA-Close = (O+H+L+C)/4, HA-Open = (previous HA-Open + previous HA-Close)/2. These averaged candles naturally smooth price action and make trend direction more visually apparent. HTM applies a secondary smoothing layer (EMA, SMA, or WMA selectable) to the HA values, further reducing noise while preserving trend structure.

The trend matrix evaluates six independent conditions and assigns a point for each: (1) smoothed HA candle direction, (2) price vs fast EMA, (3) fast EMA vs medium EMA alignment, (4) medium EMA vs slow EMA alignment, (5) price vs 200 EMA for long-term trend, and (6) DI+ vs DI- from the ADX system. The total score ranges from 0 to 6 for each direction.
**Signal Logic:**
Signals are generated only when the bullish or bearish score reaches a configurable threshold (default 4 of 6) AND ADX confirms a trending market. This multi-condition confluence approach filters out signals in choppy or low-momentum environments. Signals fire on the first bar where the score threshold is met.
**Features:**
- Smoothed Heikin-Ashi with selectable smoothing type (EMA/SMA/WMA)
- Triple EMA ribbon (fast/medium/slow) with fill coloring
- 200 EMA long-term trend reference
- 6-point confluence scoring system
- ADX trend strength gate
- Dual take-profit levels (TP1/TP2) with ATR-based calculation
- Visual score display with filled/empty dot notation
- Optional bar coloring based on signal strength
**Mathematical Foundation:**
Heikin-Ashi candles are synthetic candles calculated using averaged formulas: HA-Close = (O+H+L+C)/4, HA-Open = (previous HA-Open + previous HA-Close)/2. These averaged candles naturally smooth price action and make trend direction more visually apparent. HTM applies a secondary smoothing layer (EMA, SMA, or WMA selectable) to the HA values, further reducing noise while preserving trend structure.
The trend matrix evaluates six independent conditions and assigns a point for each: (1) smoothed HA candle direction, (2) price vs fast EMA, (3) fast EMA vs medium EMA alignment, (4) medium EMA vs slow EMA alignment, (5) price vs 200 EMA for long-term trend, and (6) DI+ vs DI- from the ADX system. The total score ranges from 0 to 6 for each direction.
**Signal Logic:**
Signals are generated only when the bullish or bearish score reaches a configurable threshold (default 4 of 6) AND ADX confirms a trending market. This multi-condition confluence approach filters out signals in choppy or low-momentum environments. Signals fire on the first bar where the score threshold is met.
**Features:**
- Smoothed Heikin-Ashi with selectable smoothing type (EMA/SMA/WMA)
- Triple EMA ribbon (fast/medium/slow) with fill coloring
- 200 EMA long-term trend reference
- 6-point confluence scoring system
- ADX trend strength gate
- Dual take-profit levels (TP1/TP2) with ATR-based calculation
- Visual score display with filled/empty dot notation
- Optional bar coloring based on signal strength
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.