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
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。