QC Directional Entropy Analyzer

A multi-confirmation trend and momentum framework combining adaptive volatility bands, machine-learning classification, kernel regression, and advanced divergence analysis.
📋 DESCRIPTION
The Directional Entropy Analyzer (DEA) is a comprehensive trend-following indicator designed to identify high-probability trade opportunities by requiring alignment across multiple independent analytical engines.
Instead of relying on a single signal source, DEA cross-validates:
Adaptive trend structure
Machine-learning-based momentum classification
Kernel regression smoothing
Multi-indicator divergence detection
This layered approach helps reduce noise, filter low-quality setups, and keep traders aligned with dominant market conditions.
🎯 KEY FEATURES
1. Dual-Band Trend System
• Main Trend Band: Defines the primary market direction using adaptive ATR-based calculations
• Short-Term Band: Captures faster momentum shifts for precise timing
• Dynamic transparency reflects trend strength (stronger trends = higher visibility)
• Optional hiding of the short-term band when it conflicts with the main trend
2. Machine Learning Classification Engine (LC)
• Uses Lorentzian distance calculations to classify market behavior
• Simultaneously analyzes multiple features (RSI, WaveTrend, CCI, ADX)
• Adapts to changing market regimes with built-in volatility, regime, and ADX filters
• Kernel regression adds smoothing and directional confirmation
3. Smart Multi-Indicator Divergence Detection
• Scans 10 separate indicators for divergence patterns
• Context-aware labeling system:
– REVERSAL: Regular divergence against the current trend (possible trend change)
– CONTINUATION: Hidden divergence aligned with the trend (trend strength)
– BULLISH / BEARISH: Standard divergence classification
• Displays divergence type (REG/HID) and indicator count
• Minimum threshold filter reduces weak or isolated signals
4. Signal Generation Logic
• Buy Signals:
– ML bullish classification
– Bullish main trend
– Kernel regression confirmation
• Sell Signals:
– ML bearish classification
– Bearish main trend
– Kernel regression confirmation
• Optional divergence filter for extra confirmation
• Visual signal intensity reflects ML confidence level
📊 HOW TO USE
Reading the Bands
• Green band below price → Bullish trend (focus on longs)
• Red band above price → Bearish trend (focus on shorts)
• Band position and color flip when trend direction changes
• Background highlights major trend shifts
Reading Signals
• Green label below bar → Buy signal
• Red label above bar → Sell signal
• Stronger color = higher ML confidence
• Signals only print when multiple conditions align
Reading Divergences
• Labels appear only when the minimum divergence threshold is met (default: 5 indicators)
• REVERSAL → Possible trend exhaustion (use caution)
• CONTINUATION → Trend likely to persist (potential add-on entries)
• Number in parentheses shows how many indicators detected divergence
Info Panel Overview
The real-time panel displays:
• Trend: Main trend direction
• Short: Short-term trend and alignment (✓ / ✗)
• LC: Machine learning signal direction
• Kernel: Kernel regression direction
• Div: Divergence status
• Count: Number of diverging indicators
Recommended Workflow
Identify the main trend using the bands
Wait for an LC signal in the trend direction
Check divergence status for confirmation or warning
Enter on signal and use the band as a trailing reference
⚙️ SETTINGS GUIDE
Divergence Settings
• Minimum Number of Divergences: Higher = fewer, stronger signals (default: 5)
• Divergence Type: Regular, Hidden, or Both
• Pivot Period: Lookback window for pivot detection
• Individual Indicators: Enable or disable specific oscillators
LC (Machine Learning) Settings
• Neighbors Count: Lower = faster response, higher = smoother
• Feature Count: Number of technical features analyzed
• Filters: Volatility, regime, and ADX filters to improve signal quality
Kernel Settings
• Trade with Kernel: Require kernel confirmation
• Lookback Window: Kernel regression smoothing period
Display Settings
• Hide short-term band when opposite the main trend
• Optional ML-based bar coloring
• Optional trade statistics panel
⚠️ IMPORTANT NOTES
• No repainting: Signals are confirmed on bar close
• Not financial advice: This is a technical analysis tool
• Backtest thoroughly before live use
• Always apply proper risk management
• Performs best in trending markets; ranging markets may increase false signals
🙏 CREDITS & ACKNOWLEDGMENTS
This script builds upon concepts shared within the Pine Script community:
• Lorentzian Classification concepts inspired by jdehorty
• Multi-indicator divergence detection based on LonesomeTheBlue’s work
• Adaptive band structure and system integration are original implementations
Respect and thanks to the authors for contributing their knowledge.
📝 CHANGELOG
v1.0 — Initial Release
• Dual adaptive trend bands with dynamic transparency
• Lorentzian Classification ML engine with configurable features
• Kernel regression confirmation system
• 10-indicator divergence detection with contextual labeling
• Comprehensive filtering (volatility, regime, ADX)
• Real-time info panel and trade statistics
💬 FEEDBACK
If you find this indicator useful, feedback and suggestions are always welcome.
Trade safely and manage your risk.
Script su invito
Solo gli utenti approvati dall'autore possono accedere a questo script. È necessario richiedere e ottenere l'autorizzazione per utilizzarlo. Tale autorizzazione viene solitamente concessa dopo il pagamento. Per ulteriori dettagli, seguire le istruzioni dell'autore riportate di seguito o contattare direttamente QuantCandles.
TradingView NON consiglia di acquistare o utilizzare uno script a meno che non si abbia piena fiducia nel suo autore e se ne comprenda il funzionamento. È inoltre possibile trovare alternative gratuite e open source nei nostri script della community.
Istruzioni dell'autore
Declinazione di responsabilità
Script su invito
Solo gli utenti approvati dall'autore possono accedere a questo script. È necessario richiedere e ottenere l'autorizzazione per utilizzarlo. Tale autorizzazione viene solitamente concessa dopo il pagamento. Per ulteriori dettagli, seguire le istruzioni dell'autore riportate di seguito o contattare direttamente QuantCandles.
TradingView NON consiglia di acquistare o utilizzare uno script a meno che non si abbia piena fiducia nel suo autore e se ne comprenda il funzionamento. È inoltre possibile trovare alternative gratuite e open source nei nostri script della community.