OPEN-SOURCE SCRIPT
AetherEdge - Adaptive MTF Fusion

🖊️ Overview
AE-AMF fuses momentum from several timeframes into one oscillator — but instead of mixing them equally, it learns online how well each timeframe has predicted forward returns and weights it accordingly. Timeframes that have been accurate gain influence automatically, a timeframe that leads the wrong way is sign-flipped, and an unhelpful timeframe's weight converges to near zero. The weights follow the reality that different timeframes lead in different regimes.
🔶 Key Features
A consensus oscillator fusing four timeframes (default: chart / 60 / 240 / D)
Per-timeframe weights learned online — allocated by predictive power (inverse TFs flipped, uncorrelated ≈ 0)
Reliability-weighted, so the fused value stays bounded in [−1, +1] and easy to read
BUY/SELL signals on threshold crosses of the fused value, with a TF agreement count (agree/4)
A gold HUD showing fused value, bias, each TF's learned weight %, agreement, and predicted move
Non-repainting MTF — each higher timeframe reads only its last closed bar (expr[1] + lookahead_off); signals gate on bar close
🧠 Technical Architecture
Multi-TF momentum: on each timeframe, ROC is z-scored and passed through tanh to a bounded [−1, 1] momentum. Higher timeframes are pulled via request.security, but adding [1] to the expression with lookahead_off reads only the last closed HTF bar — so it does not repaint.
Weight learning (ML): the K = 4 timeframe momenta are features and the realized forward return (ATR units) is the target for an online linear regression (SGD squared loss + L2). The learned coefficients θ_i are each timeframe's weight: accurate TFs get large |θ_i|, an inversely-leading TF gets negative θ_i (flipped in the fusion), and an uncorrelated TF gets θ_i ≈ 0. Labels are H-bar lagged — no lookahead.
Fusion: a reliability-weighted consensus, fused = Σ p_i · sign(θ_i) · mom_i with p_i = |θ_i| / Σ|θ|. Since the weights sum to one, the fused value is bounded. The regression's point estimate Σ θ_i · mom_i serves as the predicted move (ATR units) for confidence.
Honest scope: a linear model over timeframe momenta. Not deep learning, and not a guarantee of the future.
⚙️ Recommended Settings & Tuning Guide
Key parameters: the four timeframes, momentum length, learning horizon (H), learning rate (lr), fusion signal threshold (thr), warmup.
Set timeframes equal to or higher than the chart (lower TFs just hold their last value and add little)
Larger H → slower weight learning, swing-oriented; smaller → faster adaptation, short-term
Raise thr → only strong consensus signals; lower → more responsive
Crypto starting points (tune on your chart):
BTC / ETH: on a 15m–1H chart, TF = current / 1H / 4H / D pairs well
SOL / XRP and high-vol alts: thr ≈ 0.2 to suppress noisy flips
Scalping (1–5m): TF = current / 15m / 1H / 4H, H ≈ 5 for fast adaptation
Swing (4H–daily): TF = 4H / D / W / M, longer H to learn higher-timeframe leadership
Warmup suppresses signals until the regression spins up; weights move early on
💡 How to Use in Practice
Momentum alignment: the fused sign is the bias; enter on threshold crosses. See multi-TF agreement in one indicator
Reading the weight panel: the % shows which timeframe is currently leading — generally follow the trend of the heaviest-weighted TF
Agreement (agree/4): 3/4 or 4/4 is a strong trend-following environment; a split read suggests caution
Predicted move: the regression's point estimate, consistent with the fused sign, gauges move size
Combinations: pair with AE-VECTOR's target band or AE-IRM's mean-reversion probability, and use AMF to confirm the big-picture momentum direction
⚠️ Important Notes
Learning period: no signals until warmup bars; weights need time to settle
Learning reset: changing inputs, symbol, timeframe, or the TF set re-learns the weights
One-HTF-bar lag: for no-repaint, each timeframe reads a closed bar, so even the fastest TF lags ~1 bar (the trade-off for avoiding fakeouts)
Momentum's nature: in strong ranges the fused value can oscillate around zero — use the agreement count and position sizing together
🚨 Disclaimer
This indicator is for educational and informational purposes only and is not financial advice or a recommendation to buy or sell. No method guarantees future profits; past performance does not indicate future results, and trading carries the risk of loss. All trading decisions are your own — use proper backtesting and disciplined risk management.
AE-AMF fuses momentum from several timeframes into one oscillator — but instead of mixing them equally, it learns online how well each timeframe has predicted forward returns and weights it accordingly. Timeframes that have been accurate gain influence automatically, a timeframe that leads the wrong way is sign-flipped, and an unhelpful timeframe's weight converges to near zero. The weights follow the reality that different timeframes lead in different regimes.
🔶 Key Features
A consensus oscillator fusing four timeframes (default: chart / 60 / 240 / D)
Per-timeframe weights learned online — allocated by predictive power (inverse TFs flipped, uncorrelated ≈ 0)
Reliability-weighted, so the fused value stays bounded in [−1, +1] and easy to read
BUY/SELL signals on threshold crosses of the fused value, with a TF agreement count (agree/4)
A gold HUD showing fused value, bias, each TF's learned weight %, agreement, and predicted move
Non-repainting MTF — each higher timeframe reads only its last closed bar (expr[1] + lookahead_off); signals gate on bar close
🧠 Technical Architecture
Multi-TF momentum: on each timeframe, ROC is z-scored and passed through tanh to a bounded [−1, 1] momentum. Higher timeframes are pulled via request.security, but adding [1] to the expression with lookahead_off reads only the last closed HTF bar — so it does not repaint.
Weight learning (ML): the K = 4 timeframe momenta are features and the realized forward return (ATR units) is the target for an online linear regression (SGD squared loss + L2). The learned coefficients θ_i are each timeframe's weight: accurate TFs get large |θ_i|, an inversely-leading TF gets negative θ_i (flipped in the fusion), and an uncorrelated TF gets θ_i ≈ 0. Labels are H-bar lagged — no lookahead.
Fusion: a reliability-weighted consensus, fused = Σ p_i · sign(θ_i) · mom_i with p_i = |θ_i| / Σ|θ|. Since the weights sum to one, the fused value is bounded. The regression's point estimate Σ θ_i · mom_i serves as the predicted move (ATR units) for confidence.
Honest scope: a linear model over timeframe momenta. Not deep learning, and not a guarantee of the future.
⚙️ Recommended Settings & Tuning Guide
Key parameters: the four timeframes, momentum length, learning horizon (H), learning rate (lr), fusion signal threshold (thr), warmup.
Set timeframes equal to or higher than the chart (lower TFs just hold their last value and add little)
Larger H → slower weight learning, swing-oriented; smaller → faster adaptation, short-term
Raise thr → only strong consensus signals; lower → more responsive
Crypto starting points (tune on your chart):
BTC / ETH: on a 15m–1H chart, TF = current / 1H / 4H / D pairs well
SOL / XRP and high-vol alts: thr ≈ 0.2 to suppress noisy flips
Scalping (1–5m): TF = current / 15m / 1H / 4H, H ≈ 5 for fast adaptation
Swing (4H–daily): TF = 4H / D / W / M, longer H to learn higher-timeframe leadership
Warmup suppresses signals until the regression spins up; weights move early on
💡 How to Use in Practice
Momentum alignment: the fused sign is the bias; enter on threshold crosses. See multi-TF agreement in one indicator
Reading the weight panel: the % shows which timeframe is currently leading — generally follow the trend of the heaviest-weighted TF
Agreement (agree/4): 3/4 or 4/4 is a strong trend-following environment; a split read suggests caution
Predicted move: the regression's point estimate, consistent with the fused sign, gauges move size
Combinations: pair with AE-VECTOR's target band or AE-IRM's mean-reversion probability, and use AMF to confirm the big-picture momentum direction
⚠️ Important Notes
Learning period: no signals until warmup bars; weights need time to settle
Learning reset: changing inputs, symbol, timeframe, or the TF set re-learns the weights
One-HTF-bar lag: for no-repaint, each timeframe reads a closed bar, so even the fastest TF lags ~1 bar (the trade-off for avoiding fakeouts)
Momentum's nature: in strong ranges the fused value can oscillate around zero — use the agreement count and position sizing together
🚨 Disclaimer
This indicator is for educational and informational purposes only and is not financial advice or a recommendation to buy or sell. No method guarantees future profits; past performance does not indicate future results, and trading carries the risk of loss. All trading decisions are your own — use proper backtesting and disciplined risk management.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.