PROTECTED SOURCE SCRIPT
Trend Matrix

Final TradingView-Compliant Description for Trend Matrix
Trend Matrix is a precision-engineered trend-following strategy built for high-confidence entries and tactical trade management.
This strategy combines multiple non-repainting filters, each with a distinct role, to form a unified "trend matrix" that confirms directional bias, volume commitment, and momentum strength — all before entry is considered.
🔍 Core Components & Why They’re Used
🧠 Gaussian Filter (Custom)
A smoothed Gaussian-weighted moving average is used to detect trend direction changes. Unlike standard EMAs, this filter minimizes lag while retaining smooth transitions — ideal for confirming trend shifts without false reversals.
📈 RMI Trend Memory
A Relative Momentum Index is used to validate trend direction persistence. RMI's ability to filter out short-term oscillations makes it ideal for confirming whether a trend is still active.
📊 Gradient Filter (ZLEMA-based)
Measures the slope of a ZLEMA-smoothed close. If slope flips, it signals a potential trend weakness. This provides real-time confirmation for entry or exit bias.
📉 Volume Spike Detection
Confirms that breakouts or trend continuations are supported by volume commitment. Uses a dynamic SMA-based volume filter with a user-defined multiplier.
🟦 White Line (Bias Midpoint)
This structural component calculates the midpoint of the highest high and lowest low over a range — providing directional context and helping eliminate trades in consolidation zones.
🎯 Entry Conditions
Long entries require:
Gaussian trend flip to the upside
RMI > 50 (bullish memory)
Volume spike confirmation
Positive gradient (ZLEMA slope)
Price above White Line (bias filter)
Short entries use the inverse logic.
All entries enforce a cooldown bar to prevent same-bar reversals or whipsaw trades.
🎯 Exit Conditions
Take Profit 1: 50% of position at +2%
Take Profit 2: Remaining 50% at +4%
Early Exit on Trend Weakness:
Position closes fully if the trend weakens (RMI flip or gradient reversal)
📊 Dashboard + Performance Tracking
The built-in dashboard shows:
Current Position
Entry Price
TP1/TP2 Hit Status
Bars Since Entry
Win Rate (%)
Profit Factor
Useful for manual tracking or live trading review.
🌐 Multi-Exchange Bot Compatibility
Trend Matrix is built with universal trade alerts using customizable comment= fields. This makes it compatible with any exchange-connected bot platform such as:
WunderTrading
3Commas
Alertatron
Cornix
Or any webhook-based trading system
Alerts are sent using the {{strategy.order.comment}} placeholder, allowing you to route entries and exits through your preferred exchange account on Binance, Bybit, OKX, Kraken, and others.
🛠️ Customization
All components are modular:
TP1/TP2 levels
Gaussian length & sigma
Volume spike filter sensitivity
Gradient & White Line length
RMI settings
You can tailor the strategy for different assets or timeframes — optimized for crypto 1H, but works with stocks, FX, or lower timeframes with adjusted parameters.
✅ Final Notes
Trend Matrix is not just a mashup — it's a synchronized system of filters with clear roles, designed to maximize trade confidence and minimize noise. Every layer of confirmation serves a purpose, making this a highly adaptive trend-following tool for any market environment.
⚠️ Disclaimer (as required by TradingView)
This script is for educational purposes only and does not constitute financial advice. Use at your own risk. Always test strategies thoroughly before applying them in live trading environments. Past performance is not indicative of future results.
Trend Matrix is a precision-engineered trend-following strategy built for high-confidence entries and tactical trade management.
This strategy combines multiple non-repainting filters, each with a distinct role, to form a unified "trend matrix" that confirms directional bias, volume commitment, and momentum strength — all before entry is considered.
🔍 Core Components & Why They’re Used
🧠 Gaussian Filter (Custom)
A smoothed Gaussian-weighted moving average is used to detect trend direction changes. Unlike standard EMAs, this filter minimizes lag while retaining smooth transitions — ideal for confirming trend shifts without false reversals.
📈 RMI Trend Memory
A Relative Momentum Index is used to validate trend direction persistence. RMI's ability to filter out short-term oscillations makes it ideal for confirming whether a trend is still active.
📊 Gradient Filter (ZLEMA-based)
Measures the slope of a ZLEMA-smoothed close. If slope flips, it signals a potential trend weakness. This provides real-time confirmation for entry or exit bias.
📉 Volume Spike Detection
Confirms that breakouts or trend continuations are supported by volume commitment. Uses a dynamic SMA-based volume filter with a user-defined multiplier.
🟦 White Line (Bias Midpoint)
This structural component calculates the midpoint of the highest high and lowest low over a range — providing directional context and helping eliminate trades in consolidation zones.
🎯 Entry Conditions
Long entries require:
Gaussian trend flip to the upside
RMI > 50 (bullish memory)
Volume spike confirmation
Positive gradient (ZLEMA slope)
Price above White Line (bias filter)
Short entries use the inverse logic.
All entries enforce a cooldown bar to prevent same-bar reversals or whipsaw trades.
🎯 Exit Conditions
Take Profit 1: 50% of position at +2%
Take Profit 2: Remaining 50% at +4%
Early Exit on Trend Weakness:
Position closes fully if the trend weakens (RMI flip or gradient reversal)
📊 Dashboard + Performance Tracking
The built-in dashboard shows:
Current Position
Entry Price
TP1/TP2 Hit Status
Bars Since Entry
Win Rate (%)
Profit Factor
Useful for manual tracking or live trading review.
🌐 Multi-Exchange Bot Compatibility
Trend Matrix is built with universal trade alerts using customizable comment= fields. This makes it compatible with any exchange-connected bot platform such as:
WunderTrading
3Commas
Alertatron
Cornix
Or any webhook-based trading system
Alerts are sent using the {{strategy.order.comment}} placeholder, allowing you to route entries and exits through your preferred exchange account on Binance, Bybit, OKX, Kraken, and others.
🛠️ Customization
All components are modular:
TP1/TP2 levels
Gaussian length & sigma
Volume spike filter sensitivity
Gradient & White Line length
RMI settings
You can tailor the strategy for different assets or timeframes — optimized for crypto 1H, but works with stocks, FX, or lower timeframes with adjusted parameters.
✅ Final Notes
Trend Matrix is not just a mashup — it's a synchronized system of filters with clear roles, designed to maximize trade confidence and minimize noise. Every layer of confirmation serves a purpose, making this a highly adaptive trend-following tool for any market environment.
⚠️ Disclaimer (as required by TradingView)
This script is for educational purposes only and does not constitute financial advice. Use at your own risk. Always test strategies thoroughly before applying them in live trading environments. Past performance is not indicative of future results.
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
受保護腳本
此腳本以閉源形式發佈。 不過,您可以自由且不受任何限制地使用它 — 在此處了解更多資訊。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。