AlphaEngine █ ALPHAENGINE v1.0
The Adaptive Consensus Trading Algorithm
Self-optimizing signal engine that runs 6 independent "Expert" sub-systems simultaneously, tracks their real-time accuracy, and dynamically adjusts their influence using an Adaptive Consensus algorithm inspired by the Multiplicative Weight Update method. The result: an indicator that learns which strategies work best in the current market — and automatically amplifies them while suppressing underperformers. All in real-time, on every single bar.
Free and Open Source.
█ THE 6 EXPERTS
1. Trend Expert
Triple EMA alignment (Fast/Mid/Slow) combined with ADX trend strength. Detects directional bias and amplifies signals when the trend is strong.
2. Momentum Expert
Blends RSI zone analysis (40%), Stochastic crossover (30%), and Rate-of-Change velocity (30%) into a single momentum score. Catches acceleration and deceleration in price moves.
3. Volume Expert
On-Balance Volume trend direction combined with real-time volume spike detection. Confirms signals with institutional participation. Volume must agree with price direction for full score.
4. Volatility Expert
Bollinger Band position mapping combined with ATR expansion/contraction analysis. Includes Squeeze Detection that alerts before major breakout moves.
5. Supertrend Expert
ATR-based dynamic support/resistance with distance scaling. Stronger signals when price is firmly above/below the supertrend line.
6. Structure Expert
Higher-timeframe EMA bias using auto-selected HTF (e.g., 1H chart checks 4H, 5m chart checks 1H). Ensures signals align with the macro trend.
█ THE ADAPTIVE WEIGHTING ENGINE
Unlike traditional indicators that treat all components equally, AlphaEngine tracks which experts are actually performing well in the current market conditions:
Each expert's predictions are validated against real price movement
A rolling accuracy score (exponential decay) measures recent performance
Weights are computed as accuracy squared — creating clear differentiation
Experts with high accuracy get amplified, poor performers get dampened
The engine adapts to any market environment automatically
In a strong trending market, the Trend and Supertrend experts naturally gain weight. In a ranging/choppy market, Momentum and Volume experts take over. The engine adapts automatically.
█ SIGNAL GRADING: A/B/C
A-Grade (75%+ consensus) — High quality. Strong agreement among key experts.
B-Grade (60%+ consensus) — Standard. Moderate agreement. Use with additional confirmation.
C-Grade (50%+ consensus) — Weak. Minimal consensus. For analysis only. Filterable via settings.
Signal labels are visual: A-grade signals are larger and prominent. B/C are smaller and subtle. A minimum grade filter lets you hide weaker signals.
█ RISK MANAGEMENT
Take Profit + Stop Loss:
TP1 — ATR-based take profit target with visual line and hit detection
SL — Dynamic ATR-based stop loss, adapts to current volatility
Visual checkmark when TP1 is reached, X marker when SL triggers. Both levels are always proportional to market conditions — never fixed distances.
█ VISUAL FEATURES
Smart Candle Coloring — 6-level gradient from deep green to deep red based on consensus strength
Trend Background — Subtle gradient overlay showing macro direction
Volatility Bands — Dynamic Bollinger-based bands with squeeze highlight
Squeeze Detection — Diamond dots below price when volatility contracts
Supertrend Line — Color-coded dynamic support/resistance
EMA Lines — Optional Fast/Mid/Slow EMA visualization
█ DASHBOARD
Compact 10-row real-time analytics panel: Current signal + grade + consensus %, visual consensus bar, each expert's direction + rolling accuracy %, and volatility state (Squeeze/Expand/Contract/Normal).
█ ALERTS (7 CONDITIONS)
Signal: Buy/Sell, A-Grade Buy/Sell
Risk: TP1 Hit, SL Hit
Volatility: Squeeze Start
█ PRO VERSION
The PRO version adds:
VWAP Expert — 7th expert for institutional fair-value bias with timeframe auto-scaling
Trading Style Presets — Auto/Scalping/Intraday/Swing/Position/Custom with automatic parameter tuning
Asset Auto-Optimization — Crypto/Forex/Stocks/Futures multipliers for volatility and volume sensitivity
RSI Divergence Detection — Regular + Hidden divergences with visual labels and connecting lines
S-Grade Signals — Elite setup grade (90%+ consensus) for highest probability entries
Multi-Target TP — TP1/TP2/TP3 system with sequential hit detection and R:R ratio display
Premium Dashboard — 17-row analytics panel with all expert weights, divergence status, and TP tracking
17 Alert Conditions — Including divergence alerts, squeeze breakout, trend flip, and grade-specific triggers
█ NON-REPAINTING
All calculations use standard non-repainting indicators (EMA, RSI, ADX, ATR, OBV, Stochastic, Bollinger Bands). Multi-timeframe data uses confirmed prior-bar values. No repainting.
█ WORKS ON
Crypto, Forex, Stocks, Futures, Indices, Commodities and Bonds — any timeframe from 1 second to Monthly.
█ DISCLAIMER
This indicator is for educational and informational purposes only. It does not constitute financial advice. Past performance does not guarantee future results. No indicator can predict market movements with certainty. Always implement proper risk management. Use this tool as one component of a comprehensive trading strategy, not as a standalone decision-making system.
Chỉ báo Pine Script®






















