OPEN-SOURCE SCRIPT
AetherEdge Adaptive Fibonacci AI

🖊️ Overview
AetherEdge Adaptive Fibonacci AI is a machine-learning-driven adaptive Fibonacci engine that completely transcends traditional static ratios. A KNN (K-Nearest Neighbors) algorithm extracts the most similar historical regimes from up to 2,000 prior bars and learns which golden ratios actually worked in those analogous conditions. It then probabilistically computes a breakout probability for each level — a revolutionary tool that visualizes "which Fib will hold" as a forward-looking forecast.
🔶 Key Features
Dynamic Swing Detection: ATR-based filtering of meaningful swings only
KNN Similarity Engine: 6-dimensional feature × cosine similarity matching
Adaptive Fibonacci: Learns ratios that worked in similar regimes
3 Modes: Standard (fixed) / Adaptive (learned) / Hybrid (fused)
Breakout Probability Forecast: % probability displayed per level
3-Tier Color Coding: High / Mid / Low breakout probability
Predicted Extension Lines: 1.272 / 1.618 / 2.0 projection rendering
Dynamic Line Width: Higher similarity = thicker emphasis
Stats Panel: Visualizes similarity, ratio adoption, and processing state
🧠 Technical Architecture
This indicator is a KNN-driven Fibonacci AI that "learns from the past."
Swing Detection: pivothigh / pivotlow at swingLen, filtered by minSwingATR × ATR to eliminate noise. Swing ID tracking minimizes recomputation.
6-Dimensional Feature Vector: ①Return (f_ret) ②Volatility ratio (f_volaRatio) ③Volume ratio (f_volRatio) ④EMA slope (f_slope) ⑤Range position (f_rangePos) ⑥Normalized RSI (f_rsi) — vectorizes current market state.
Cosine Similarity: Computes similarity between the current vector and each historical state vector, quantifying regime resemblance on a -1 to 1 scale.
KNN Search: Scans historyBars range with sampleStep intervals, extracts top-K (knnK) similar states. similarityMin threshold filters out low-quality matches.
Level Harvesting: Reverse-engineers reactive price levels from analogous regimes, matches them against candidateRatios (18 ratios from 0.146 to 2.618), and accumulates them into adaptiveRatios.
Weighted Voting: Each ratio is quality-scored via similarity-weighted voting.
Breakout Probability: Calculated from price behavior (break vs. respect) around each level over probLookback bars.
Hybrid Mode: Combines standard Fibs with adaptive Fibs to harness both worlds.
⚙️ Recommended Settings & Tuning Guide
Crypto Defaults:
BTC (4H): swingLen=10, knnK=8, historyBars=2000, similarityMin=0.55
ETH (1H): swingLen=8, knnK=10, historyBars=1500, similarityMin=0.50
SOL/XRP (15M): swingLen=6, knnK=12, historyBars=1200, similarityMin=0.45
Long-Term (1D): swingLen=15, knnK=6, historyBars=3000, similarityMin=0.60
Tuning Guide:
Precision: similarityMin=0.70, knnK=5 for ultra-selective matching
Maximum learning: historyBars=4000, sampleStep=2 to maximize data
Speed priority: sampleStep=5, featureLen=15 to reduce load
Trending markets: includeExt=true, showBeyond=true for projection emphasis
Range markets: adaptMode=Adaptive to prioritize learned ratios
Beginners: adaptMode=Hybrid offers the safest standard + AI dual view
💡 How to Use in Practice
High-Probability Bounce: colLowProb (green) levels are strong S/R — bounce entry candidates
Breakout Plays: colHighProb (red) levels signal high break expectation — follow-through trades
Adaptive Edge: Non-standard ratios (0.65, 0.707, etc.) appearing in Adaptive mode are regime-specific key levels
Extension Targets: Use 1.272 / 1.618 / 2.0 projections for take-profit
Multi-Timeframe: Higher TF adaptive Fibs + lower TF entry refinement
AetherEdge Synergy: When Neural OB Evolution elite OBs overlap an adaptive Fib → confluence powerhouse zone
⚠️ Important Notes
The first several hundred bars lack training data, so Adaptive mode may not function well early on
Increasing historyBars improves accuracy but raises computational load (trade-off)
Effectiveness drops during sudden regime shifts that have no historical analog
Levels are not drawn until swings confirm (swingLen bars later)
KNN processing executes on bar close — real-time reflection occurs on the next bar
Excessively large featureLen risks over-referencing outdated patterns
🚨 Disclaimer
This indicator is provided for educational and research purposes only and does not constitute financial advice. KNN similarity and probability forecasts 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 Adaptive Fibonacci AI is a machine-learning-driven adaptive Fibonacci engine that completely transcends traditional static ratios. A KNN (K-Nearest Neighbors) algorithm extracts the most similar historical regimes from up to 2,000 prior bars and learns which golden ratios actually worked in those analogous conditions. It then probabilistically computes a breakout probability for each level — a revolutionary tool that visualizes "which Fib will hold" as a forward-looking forecast.
🔶 Key Features
Dynamic Swing Detection: ATR-based filtering of meaningful swings only
KNN Similarity Engine: 6-dimensional feature × cosine similarity matching
Adaptive Fibonacci: Learns ratios that worked in similar regimes
3 Modes: Standard (fixed) / Adaptive (learned) / Hybrid (fused)
Breakout Probability Forecast: % probability displayed per level
3-Tier Color Coding: High / Mid / Low breakout probability
Predicted Extension Lines: 1.272 / 1.618 / 2.0 projection rendering
Dynamic Line Width: Higher similarity = thicker emphasis
Stats Panel: Visualizes similarity, ratio adoption, and processing state
🧠 Technical Architecture
This indicator is a KNN-driven Fibonacci AI that "learns from the past."
Swing Detection: pivothigh / pivotlow at swingLen, filtered by minSwingATR × ATR to eliminate noise. Swing ID tracking minimizes recomputation.
6-Dimensional Feature Vector: ①Return (f_ret) ②Volatility ratio (f_volaRatio) ③Volume ratio (f_volRatio) ④EMA slope (f_slope) ⑤Range position (f_rangePos) ⑥Normalized RSI (f_rsi) — vectorizes current market state.
Cosine Similarity: Computes similarity between the current vector and each historical state vector, quantifying regime resemblance on a -1 to 1 scale.
KNN Search: Scans historyBars range with sampleStep intervals, extracts top-K (knnK) similar states. similarityMin threshold filters out low-quality matches.
Level Harvesting: Reverse-engineers reactive price levels from analogous regimes, matches them against candidateRatios (18 ratios from 0.146 to 2.618), and accumulates them into adaptiveRatios.
Weighted Voting: Each ratio is quality-scored via similarity-weighted voting.
Breakout Probability: Calculated from price behavior (break vs. respect) around each level over probLookback bars.
Hybrid Mode: Combines standard Fibs with adaptive Fibs to harness both worlds.
⚙️ Recommended Settings & Tuning Guide
Crypto Defaults:
BTC (4H): swingLen=10, knnK=8, historyBars=2000, similarityMin=0.55
ETH (1H): swingLen=8, knnK=10, historyBars=1500, similarityMin=0.50
SOL/XRP (15M): swingLen=6, knnK=12, historyBars=1200, similarityMin=0.45
Long-Term (1D): swingLen=15, knnK=6, historyBars=3000, similarityMin=0.60
Tuning Guide:
Precision: similarityMin=0.70, knnK=5 for ultra-selective matching
Maximum learning: historyBars=4000, sampleStep=2 to maximize data
Speed priority: sampleStep=5, featureLen=15 to reduce load
Trending markets: includeExt=true, showBeyond=true for projection emphasis
Range markets: adaptMode=Adaptive to prioritize learned ratios
Beginners: adaptMode=Hybrid offers the safest standard + AI dual view
💡 How to Use in Practice
High-Probability Bounce: colLowProb (green) levels are strong S/R — bounce entry candidates
Breakout Plays: colHighProb (red) levels signal high break expectation — follow-through trades
Adaptive Edge: Non-standard ratios (0.65, 0.707, etc.) appearing in Adaptive mode are regime-specific key levels
Extension Targets: Use 1.272 / 1.618 / 2.0 projections for take-profit
Multi-Timeframe: Higher TF adaptive Fibs + lower TF entry refinement
AetherEdge Synergy: When Neural OB Evolution elite OBs overlap an adaptive Fib → confluence powerhouse zone
⚠️ Important Notes
The first several hundred bars lack training data, so Adaptive mode may not function well early on
Increasing historyBars improves accuracy but raises computational load (trade-off)
Effectiveness drops during sudden regime shifts that have no historical analog
Levels are not drawn until swings confirm (swingLen bars later)
KNN processing executes on bar close — real-time reflection occurs on the next bar
Excessively large featureLen risks over-referencing outdated patterns
🚨 Disclaimer
This indicator is provided for educational and research purposes only and does not constitute financial advice. KNN similarity and probability forecasts 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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.