OPEN-SOURCE SCRIPT
MACD with Smart Entry Signals & Trend Filter

This advanced MACD indicator combines traditional MACD analysis with intelligent entry signal detection and an optional EMA trend filter. It identifies high-probability entry points by analyzing histogram patterns, consolidation phases, and trend continuation setups.
### Key Features
**🎯 Smart Entry Detection**
- **Consolidation Breakouts**: Identifies exits from consolidation zones (weak bars) with strong momentum
- **Trend Reversals**: Detects potential trend changes after extended weak phases
- **Correction/Continuation Patterns**: Recognizes brief corrections within strong trends that offer continuation opportunities
**📊 Enhanced MACD Visualization**
- Color-coded histogram showing four distinct states:
- Strong Bullish (dark green): Rising histogram above zero
- Weak Bullish (light green): Falling histogram above zero
- Weak Bearish (light red): Rising histogram below zero
- Strong Bearish (dark red): Falling histogram below zero
**🔍 Multi-Layer Filtering System**
- **Candle Size Filter**: Eliminates signals during high volatility/large candle ranges
- **EMA Trend Filter**: Optional filter ensuring entries align with the dominant trend direction
- Visual markers for rejected signals (orange X for candle size, blue E for EMA trend)
**⚙️ Customizable Parameters**
- Adjustable MACD periods (default: 34/144/9)
- Configurable consolidation bar requirements
- Flexible correction pattern detection
- EMA trend filter with adjustable sensitivity
- Multiple alert types for all signal conditions
### How to Use
1. **Enable/disable filters** based on your trading style and market conditions
2. **Green triangles (L)**: Long entry signals when all conditions are met
3. **Red triangles (S)**: Short entry signals when all conditions are met
4. **Rejected signal markers**: Help you understand why certain setups were filtered out
5. **Background coloring**: Provides visual confirmation of signal zones and correction patterns
### Alert System
Comprehensive alerts for:
- Long and short entry signals
- Specific pattern types (consolidation, reversal, continuation)
- Rejected signals (helps refine strategy)
- Traditional MACD histogram crossovers
### Best Practices
- Use the EMA trend filter in trending markets to avoid counter-trend trades
- Adjust candle size filter based on your instrument's typical volatility
- Consider combining with support/resistance levels for confirmation
- Test different consolidation bar settings for your timeframe
### Parameters Summary
- Fast/Slow Length: MACD calculation periods
- Signal Smoothing: Signal line period
- Consolidation Bars: Minimum weak bars before breakout
- Max Candle Range: Filter for oversized candles
- EMA Period & Sensitivity: Trend filter configuration
---
*This indicator is designed for traders who want a systematic approach to identifying MACD-based entry opportunities with built-in risk management through filtering.*
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。