OPEN-SOURCE SCRIPT
AlphaEngine

â–ˆ ALPHAENGINE v1.0 [FREE]
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:
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
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:
Visual checkmark when TP1 is reached, X marker when SL triggers. Both levels are always proportional to market conditions — never fixed distances.
â–ˆ VISUAL FEATURES
â–ˆ 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)
â–ˆ PRO VERSION
The PRO version adds:
â–ˆ 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.
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.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.