OPEN-SOURCE SCRIPT
Ensemble Consensus System

The Ensemble Consensus System (ECS) brings a **Random Forest-style ensemble vote** to Pine Script: five orthogonal "expert" strategies each cast a bull/bear vote (+1/-1/0), and only high-confidence consensus moves become signals—dramatically reducing noise while capturing strong directional moves.
## What Makes This Original
ECS is the first Pine Script indicator to implement true machine learning-style ensemble voting. Rather than relying on a single methodology, five independent experts analyze different market dimensions:
• **Trend Expert**: Multi-timeframe EMA alignment analysis
• **Momentum Expert**: RSI/MACD/Stochastic confluence with consistency filters
• **Volume Expert**: Proprietary volume pressure + OBV confirmation
• **Volatility Expert**: Bollinger Band mean reversion opportunities
• **Structure Expert**: Adaptive pivot-based support/resistance detection
## How It Works
The system requires consensus among experts, with an **adaptive threshold** based on market volatility:
| Volatility Regime | ATR/Close | Votes Required |
|-------------------|-----------|----------------|
| Low Volatility | <1% | 2+ |
| Normal Markets | 1-2% | 3+ |
| High Volatility | >2% | 4+ |
This dynamic adjustment prevents overtrading in choppy conditions while maintaining responsiveness during strong trends.
## Key Features
### Signals
• **Visual entry points** with strength percentage (60% = 3/5 experts agree)
• **Adaptive thresholds** that adjust to market conditions
• **Multi-expert consensus** reduces false signals
### Risk Control
• **Dynamic stop-loss/take-profit** based on ATR
• **Regime-adjusted targets** (±50% in volatile markets)
• **Visual SL/TP lines** with exact price labels
### Analytics
• **Real-time vote panel** showing each expert's stance
• **Performance tracking** with win rate and P/L
• **Market regime indicator** (Trending/Ranging/Volatile)
• **Light Mode** for better performance on slower systems
## How to Use
1. **Apply ECS** to a liquid instrument on 15m-4H timeframe (best: 1H)
2. **Wait for signal** - green ▲ for long, red ▼ for short with strength %
3. **Verify votes** - check panel to see which experts agree
4. **Execute trade** using the displayed SL/TP levels
5. **Monitor regime** - be cautious if market regime changes
### Quick Start Settings
• **Standard Trading**: Use defaults (3 votes, adaptive mode ON)
• **Conservative**: Increase to 4 votes minimum
• **Aggressive**: Reduce to 2 votes, tighten stops
## Important Limitations
• **Chart Types**: Not compatible with Renko/Heikin-Ashi
• **Volume Data**: Requires reliable volume (forex pairs may underperform)
• **News Events**: Signals may lag during gaps/major announcements
• **Processing**: Heavy calculations - use Light Mode if needed
## Settings Guide
**Ensemble Controls**
• `Minimum Votes` (default: 3): Base threshold before volatility adjustment
• `Adaptive Mode` (default: ON): Auto-adjusts threshold by market volatility
**Visual Options**
• `Vote Panel`: Live expert voting display
• `Performance Stats`: Win rate and trade tracking
• `Light Mode`: Disables heavy visuals for speed
**Risk Parameters**
• `Stop Multiplier` (default: 2.0): ATR multiple for stop-loss
• `TP Multiplier` (default: 3.0): ATR multiple for take-profit
• `Dynamic TP` (default: ON): Adjusts targets by market regime
## Troubleshooting
**Too few signals?**
→ Lower minimum votes or check if market is ranging
**Indicator running slow?**
→ Enable Light Mode, disable performance tracking
**Weird volume votes?**
→ Verify your symbol has accurate volume data
## Technical Concepts
The ensemble approach mimics **Random Forest algorithms** where multiple decision trees vote on outcomes. By requiring agreement among experts using orthogonal methodologies, ECS filters out signals that would fail under different market lenses. The adaptive threshold addresses fixed-parameter weakness by dynamically adjusting selectivity based on volatility.
• Adaptive pivot lookback for dynamic structure detection
• Safe volume pressure calculation preventing division errors
• Momentum consistency filter reducing choppy false signals
• Unified dashboard merging vote panel + performance stats
• Regime-based dynamic take-profit adjustment
*Educational indicator demonstrating ensemble methods in Pine Script. No guarantee of future performance. Always use proper risk management and position sizing.*
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.