OPEN-SOURCE SCRIPT
AetherEdge KNN Momentum Whisper

🖊️ Overview
AetherEdge KNN Momentum Whisper is a next-generation momentum forecasting engine powered by the K-Nearest Neighbors algorithm. It builds a rolling library of up to 300 historical market patterns, instantly retrieves the K most similar precedents to the current setup, and computes a distance-weighted forecast of next-bar momentum. The result is delivered through a single, elegant histogram whose color intensity simultaneously encodes direction, magnitude, and consensus confidence.
🔶 Key Features
True KNN pattern-matching engine with rolling historical dictionary
3D feature vectors: returns, normalized RSI, ATR Z-score
Variable pattern length (3–10 bars) for tunable temporal context
Inverse-distance weighted prediction — closer matches dominate
Consensus confidence scoring measuring directional agreement among neighbors
Dynamic color intensity driven by strength × confidence
Ultra-clean single histogram visualization — direction, power, and conviction in one bar
Four smart alerts for strong signals and directional flips
🧠 Technical Architecture
1. Feature Extraction Layer (Multi-dimensional Pattern Vector)
Return: single-bar percent change
RSI Normalized: scaled to -1..+1 (×2 amplified)
ATR Z-Score: 50-bar standardized volatility
These are concatenated across patternLen bars to form vectors up to 30 dimensions.
2. Pattern Library Layer (Rolling Dictionary)
Every bar appends a (past pattern, realized future return) pair to the library. Once historySize is exceeded, oldest entries are automatically pruned — always keeping the freshest learning corpus.
3. KNN Search Layer
Computes Euclidean distances from the current pattern to every library entry, then performs selection-based extraction of the K nearest neighbors. Their future-return labels are blended via 1/(d+ε) weighting to produce the momentum forecast.
4. Confidence Scoring Layer
Counts how many of the K neighbors agree on direction (bullish vs bearish). The dominant ratio becomes the confidence score (0–1).
5. Dynamic Visualization Layer
The forecast is ATR-normalized; strength = |normalized forecast| × confidence. Transparency is interpolated between minAlpha and maxAlpha — strong signals appear bold, weak signals fade.
⚙️ Recommended Settings & Tuning Guide
Crypto Defaults
BTC (1H–4H): History 300, K=8, Pattern 5, Forecast 1
ETH (30m–2H): History 300, K=8, Pattern 5, Forecast 1
SOL (15m–1H): History 250, K=10, Pattern 4, Forecast 1
XRP (1H–4H): History 350, K=8, Pattern 6, Forecast 2
Parameter Tuning
History Size: larger = more statistical stability (300 is the sweet spot)
K (Neighbors): 3–5 = reactive, 10–15 = stable
Pattern Length: 3–4 for short-term reversals, 6–8 for trend continuation
Forecast Horizon: 1–2 highest accuracy; 3+ adds noise
Features: Return + ATR for trends, prioritize RSI in ranges
💡 How to Use in Practice
Scenario 1 — Bold-Bar Entries
Vivid (low-transparency) bars indicate high strength × high confidence — historical neighbors overwhelmingly agree. Premium signals for trend-following entries.
Scenario 2 — Histogram Flip Detection
Zero-line crossover is the earliest "whisper" of momentum reversal. Use it as exit signal in trend-following or entry in mean-reversion strategies.
Scenario 3 — Faded Bars = Caution
Highly transparent bars indicate disagreement among neighbors — the market is in unfamiliar territory. Stand aside.
Multi-Timeframe Workflow
Confirm macro direction on 4H KNN → identify setup on 1H → time entries on 15m. Pairs powerfully with S/R and regime-detection tools.
⚠️ Important Notes
Forecasts activate only after historySize + patternLen bars are accumulated
Pattern library resets on chart reload
Computationally heavy — reduce historySize to 200 on low-spec setups
Sudden regime shifts may render past patterns less informative
🚨 Disclaimer
This indicator is provided for educational and analytical purposes only and does not constitute financial advice. All trading decisions remain your sole responsibility. Past performance does not guarantee future results, and crypto markets carry substantial risk.
AetherEdge KNN Momentum Whisper is a next-generation momentum forecasting engine powered by the K-Nearest Neighbors algorithm. It builds a rolling library of up to 300 historical market patterns, instantly retrieves the K most similar precedents to the current setup, and computes a distance-weighted forecast of next-bar momentum. The result is delivered through a single, elegant histogram whose color intensity simultaneously encodes direction, magnitude, and consensus confidence.
🔶 Key Features
True KNN pattern-matching engine with rolling historical dictionary
3D feature vectors: returns, normalized RSI, ATR Z-score
Variable pattern length (3–10 bars) for tunable temporal context
Inverse-distance weighted prediction — closer matches dominate
Consensus confidence scoring measuring directional agreement among neighbors
Dynamic color intensity driven by strength × confidence
Ultra-clean single histogram visualization — direction, power, and conviction in one bar
Four smart alerts for strong signals and directional flips
🧠 Technical Architecture
1. Feature Extraction Layer (Multi-dimensional Pattern Vector)
Return: single-bar percent change
RSI Normalized: scaled to -1..+1 (×2 amplified)
ATR Z-Score: 50-bar standardized volatility
These are concatenated across patternLen bars to form vectors up to 30 dimensions.
2. Pattern Library Layer (Rolling Dictionary)
Every bar appends a (past pattern, realized future return) pair to the library. Once historySize is exceeded, oldest entries are automatically pruned — always keeping the freshest learning corpus.
3. KNN Search Layer
Computes Euclidean distances from the current pattern to every library entry, then performs selection-based extraction of the K nearest neighbors. Their future-return labels are blended via 1/(d+ε) weighting to produce the momentum forecast.
4. Confidence Scoring Layer
Counts how many of the K neighbors agree on direction (bullish vs bearish). The dominant ratio becomes the confidence score (0–1).
5. Dynamic Visualization Layer
The forecast is ATR-normalized; strength = |normalized forecast| × confidence. Transparency is interpolated between minAlpha and maxAlpha — strong signals appear bold, weak signals fade.
⚙️ Recommended Settings & Tuning Guide
Crypto Defaults
BTC (1H–4H): History 300, K=8, Pattern 5, Forecast 1
ETH (30m–2H): History 300, K=8, Pattern 5, Forecast 1
SOL (15m–1H): History 250, K=10, Pattern 4, Forecast 1
XRP (1H–4H): History 350, K=8, Pattern 6, Forecast 2
Parameter Tuning
History Size: larger = more statistical stability (300 is the sweet spot)
K (Neighbors): 3–5 = reactive, 10–15 = stable
Pattern Length: 3–4 for short-term reversals, 6–8 for trend continuation
Forecast Horizon: 1–2 highest accuracy; 3+ adds noise
Features: Return + ATR for trends, prioritize RSI in ranges
💡 How to Use in Practice
Scenario 1 — Bold-Bar Entries
Vivid (low-transparency) bars indicate high strength × high confidence — historical neighbors overwhelmingly agree. Premium signals for trend-following entries.
Scenario 2 — Histogram Flip Detection
Zero-line crossover is the earliest "whisper" of momentum reversal. Use it as exit signal in trend-following or entry in mean-reversion strategies.
Scenario 3 — Faded Bars = Caution
Highly transparent bars indicate disagreement among neighbors — the market is in unfamiliar territory. Stand aside.
Multi-Timeframe Workflow
Confirm macro direction on 4H KNN → identify setup on 1H → time entries on 15m. Pairs powerfully with S/R and regime-detection tools.
⚠️ Important Notes
Forecasts activate only after historySize + patternLen bars are accumulated
Pattern library resets on chart reload
Computationally heavy — reduce historySize to 200 on low-spec setups
Sudden regime shifts may render past patterns less informative
🚨 Disclaimer
This indicator is provided for educational and analytical purposes only and does not constitute financial advice. All trading decisions remain your sole responsibility. Past performance does not guarantee future results, and crypto markets carry substantial risk.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.