OPEN-SOURCE SCRIPT
AetherEdge Hybrid AI Bias

🖊️ Overview
AetherEdge Hybrid AI Bias is a cutting-edge hybrid prediction indicator that fuses two distinct machine learning paradigms: K-Nearest Neighbors (KNN) and a 4-3-1 Neural Network (MLP). By dynamically blending memory-based pattern recognition with gradient-descent online learning through confidence-weighted fusion, it achieves predictive accuracy unreachable by any single model.
🔶 Key Features
Dual AI Engine: Hybrid fusion of KNN + Neural Network
4D Feature Space: Momentum, RSI deviation, EMA position, volatility expansion
Distance-Weighted KNN: Top-8 neighbors weighted by inverse distance
Online Learning MLP: 4-3-1 tanh-activated network
Dynamic Confidence Fusion: Auto-adjusted weighting based on each model's certainty
3-Tier Bias Classification: Clear Bullish / Neutral / Bearish signals
Future Return Prediction: Forecasts directional bias at chosen horizon
Tanh-Squash Normalization: All features standardized to [-1, 1]
🧠 Technical Architecture
This indicator integrates two distinct AI paradigms into a true ensemble learning system.
Feature Engineering: ①ATR-normalized 10-bar momentum, ②scaled RSI-50 deviation, ③ATR-distance from EMA50, ④ATR vs 50-SMA expansion ratio. All compressed to [-1, 1] via the squash (tanh-like) function.
KNN Engine: Computes Euclidean distance between current 4D feature vector and historical patterns over the lookback window. Top-8 neighbors are extracted, then averaged with inverse-distance weights (1/(d+ε)). Confidence is derived as exp(-meanDistance).
Neural Network Engine: 4-input → 3-hidden (tanh) → 1-output MLP. Persistent weight variables enable genuine continual learning across bars, with gradient descent applied over mini-epochs each bar.
Target Construction: Future return at horizon, normalized by ATR × horizon, then squashed to a smooth label in [-1, 1].
Hybrid Fusion: hybridW provides static weighting; additionally, the confidence differential dynamically biases toward whichever model is more certain — an adaptive ensemble.
Threshold Classification: bullThr/bearThr discretize the prediction into three actionable bias regimes.
⚙️ Recommended Settings & Tuning Guide
Crypto Defaults:
BTC/ETH (4H–1D): lookback=100, k=8, horizon=5, hybridW=0.5
SOL/XRP (1H): lookback=150, k=10, horizon=3, nnRate=0.08 (faster learning)
Scalping (5M–15M): lookback=80, k=5, horizon=2, hybridW=0.3 (KNN-favored)
Long Swing (1D): lookback=200, k=12, horizon=10, hybridW=0.7 (NN-favored)
Parameter Tuning:
Slow/sluggish learning: Raise nnRate to 0.08–0.15, increase nnEpochs to 5
Noisy predictions: Widen bullThr/bearThr to ±0.30 for stronger filtering
New symbol/cold start: hybridW=0.3 to favor KNN (instant pattern recall)
Mature trend regime: hybridW=0.7 to favor NN (leverages trained weights)
💡 How to Use in Practice
Bias-Driven Entry: Confirmed Bullish + price pullback → long
Early Reversal Detection: Neutral → Bearish transition triggers long exit
Multi-Timeframe: Confirm 1D bias → use 1H for precise execution
AetherEdge Combinations: RFMA slope + Hybrid AI Bias agreement = elite-tier signal
Counter-Trade Filter: Avoid longs in Bearish regime; skip shorts in Bullish regime
⚠️ Important Notes
NN weights start from initial defaults — minimum lookback + 50 bars warmup recommended
NN weights reset to defaults on indicator reload
Horizon-based target uses only known historical data (no look-ahead bias)
Watch for squash function saturation during extreme volatility shocks
KNN is computationally heavy — avoid excessively large lookback values
🚨 Disclaimer
This indicator is provided for educational and research purposes only and does not constitute financial advice. AI model predictions are based on historical data and do not guarantee future performance. All trading decisions are made at your own risk and should be accompanied by proper risk management.
AetherEdge Hybrid AI Bias is a cutting-edge hybrid prediction indicator that fuses two distinct machine learning paradigms: K-Nearest Neighbors (KNN) and a 4-3-1 Neural Network (MLP). By dynamically blending memory-based pattern recognition with gradient-descent online learning through confidence-weighted fusion, it achieves predictive accuracy unreachable by any single model.
🔶 Key Features
Dual AI Engine: Hybrid fusion of KNN + Neural Network
4D Feature Space: Momentum, RSI deviation, EMA position, volatility expansion
Distance-Weighted KNN: Top-8 neighbors weighted by inverse distance
Online Learning MLP: 4-3-1 tanh-activated network
Dynamic Confidence Fusion: Auto-adjusted weighting based on each model's certainty
3-Tier Bias Classification: Clear Bullish / Neutral / Bearish signals
Future Return Prediction: Forecasts directional bias at chosen horizon
Tanh-Squash Normalization: All features standardized to [-1, 1]
🧠 Technical Architecture
This indicator integrates two distinct AI paradigms into a true ensemble learning system.
Feature Engineering: ①ATR-normalized 10-bar momentum, ②scaled RSI-50 deviation, ③ATR-distance from EMA50, ④ATR vs 50-SMA expansion ratio. All compressed to [-1, 1] via the squash (tanh-like) function.
KNN Engine: Computes Euclidean distance between current 4D feature vector and historical patterns over the lookback window. Top-8 neighbors are extracted, then averaged with inverse-distance weights (1/(d+ε)). Confidence is derived as exp(-meanDistance).
Neural Network Engine: 4-input → 3-hidden (tanh) → 1-output MLP. Persistent weight variables enable genuine continual learning across bars, with gradient descent applied over mini-epochs each bar.
Target Construction: Future return at horizon, normalized by ATR × horizon, then squashed to a smooth label in [-1, 1].
Hybrid Fusion: hybridW provides static weighting; additionally, the confidence differential dynamically biases toward whichever model is more certain — an adaptive ensemble.
Threshold Classification: bullThr/bearThr discretize the prediction into three actionable bias regimes.
⚙️ Recommended Settings & Tuning Guide
Crypto Defaults:
BTC/ETH (4H–1D): lookback=100, k=8, horizon=5, hybridW=0.5
SOL/XRP (1H): lookback=150, k=10, horizon=3, nnRate=0.08 (faster learning)
Scalping (5M–15M): lookback=80, k=5, horizon=2, hybridW=0.3 (KNN-favored)
Long Swing (1D): lookback=200, k=12, horizon=10, hybridW=0.7 (NN-favored)
Parameter Tuning:
Slow/sluggish learning: Raise nnRate to 0.08–0.15, increase nnEpochs to 5
Noisy predictions: Widen bullThr/bearThr to ±0.30 for stronger filtering
New symbol/cold start: hybridW=0.3 to favor KNN (instant pattern recall)
Mature trend regime: hybridW=0.7 to favor NN (leverages trained weights)
💡 How to Use in Practice
Bias-Driven Entry: Confirmed Bullish + price pullback → long
Early Reversal Detection: Neutral → Bearish transition triggers long exit
Multi-Timeframe: Confirm 1D bias → use 1H for precise execution
AetherEdge Combinations: RFMA slope + Hybrid AI Bias agreement = elite-tier signal
Counter-Trade Filter: Avoid longs in Bearish regime; skip shorts in Bullish regime
⚠️ Important Notes
NN weights start from initial defaults — minimum lookback + 50 bars warmup recommended
NN weights reset to defaults on indicator reload
Horizon-based target uses only known historical data (no look-ahead bias)
Watch for squash function saturation during extreme volatility shocks
KNN is computationally heavy — avoid excessively large lookback values
🚨 Disclaimer
This indicator is provided for educational and research purposes only and does not constitute financial advice. AI model predictions are based on historical data and do not guarantee future performance. All trading decisions are made at your own risk and should be accompanied by proper risk management.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.