OPEN-SOURCE SCRIPT
Marcius Studio® - Trend Detector™

Trend Detector™ — is an advanced trend detection indicator that combines statistical Z-Score analysis with a simplified ADF stationarity test.
It is designed to help traders identify strong directional moves while filtering out noise and false signals.
Unlike traditional moving average crossovers or momentum oscillators, this tool evaluates both trend direction and trend strength, giving you a clear visual overview of market conditions.
Idea
Markets spend 70–80% of the time in consolidation and only 20–30% in trending phases. The key to profitable trading is spotting when a major trend shift begins. Trend Detector™ was built exactly for this purpose — to filter noise and highlight true trend reversals.
How It Works
Features
Recommendations
Indicator Settings
Example Settings
Disclaimer
Trading and investing involve risk — always do your own research (DYOR) and seek professional advice. We are not responsible for any financial losses.
It is designed to help traders identify strong directional moves while filtering out noise and false signals.
Unlike traditional moving average crossovers or momentum oscillators, this tool evaluates both trend direction and trend strength, giving you a clear visual overview of market conditions.
Important! This indicator is intended for educational and informational purposes. It does not guarantee future performance and should be used together with proper risk management.
Idea
Markets spend 70–80% of the time in consolidation and only 20–30% in trending phases. The key to profitable trading is spotting when a major trend shift begins. Trend Detector™ was built exactly for this purpose — to filter noise and highlight true trend reversals.
How It Works
- Calculates the Z-Score of price to detect extreme deviations from the mean.
- Applies a simplified ADF t-Statistic test to confirm trend validity.
- Uses an ATR-based ribbon for clean visualization of bullish/bearish phases.
- Generates Buy/Sell signals when trend switches are confirmed.
- Displays an Info Panel with real-time metrics: Z-Score, ADF t-Stat, Trend Strength (0–100), ATR % of price.
Features
- Trend Ribbon: visually highlights bullish, bearish, or neutral phases.
- Confirmation Filter: avoids false flips by requiring multiple bars of validation.
- Strength Score: quantifies how powerful the current trend is.
- Signal Markers: “BUY” and “SELL” alerts appear directly on the chart.
- Customizable Alerts: get notified when new uptrends or downtrends are detected.
Recommendations
- Works well on swing trading timeframes (1H, 4H, Daily).
- Use in combination with support/resistance zones or volume profile tools for higher accuracy.
- The higher the Trend Strength Score, the more reliable the trend continuation.
Indicator Settings
- Analysis Period: number of bars for Z-Score & ADF test.
- ATR Length: used for ribbon visualization.
- Min Bars to Confirm Trend: filters false trend flips.
- Show/Hide options for Ribbon, Signals, and Info Panel.
Example Settings
- Timeframe: 1H or 4H
- Analysis Period: 20
- ATR Length: 14
- Min Confirmation Bars: 2–3
Disclaimer
Trading and investing involve risk — always do your own research (DYOR) and seek professional advice. We are not responsible for any financial losses.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
Need a custom TradingView bot, indicator, strategy? We'll develop a solution tailored to your needs. Build your idea at studio.marcius.com
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
Need a custom TradingView bot, indicator, strategy? We'll develop a solution tailored to your needs. Build your idea at studio.marcius.com
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。