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.*
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.