OPEN-SOURCE SCRIPT

AetherEdge KNN Breakout Fortress

5 155
🖊️ Overview
AetherEdge KNN Breakout Fortress is a revolutionary fortress-style indicator that automatically detects price congestion zones (walls) via K-Means clustering and uses a KNN classifier to distinguish "real breakouts" from "fake breakouts" in real time. Every breakout becomes labeled training data after a confirmation window, allowing the system to evolve and adapt to your specific market's wall patterns. End the era of being trapped by fake-outs — this is the next-generation tool built exclusively for breakout strategy.

🔶 Key Features

K-Means Zone Detection: Lloyd's algorithm auto-clusters key price levels
Volume-Weighted Seeding: Volume-weighted price-point clustering
7D KNN Classifier: Density, distance, volatility, RSI, BB-width, age, touches
Real vs Fake Classification: Probability-based wall strength color coding
Pending Learning: Labels assigned N bars after break, then memory updates
Volume Confirmation: Breakouts validated only above volMult threshold
ATR Buffer: Filters out noise-level breaks
Dynamic Zone Extension: Post-break zone projection
Stats Dashboard: Real/fake counts visualization

🧠 Technical Architecture

This indicator is an AI-driven decision system designed to "see through the true nature of every wall."

K-Means Zone Detection: Collects high/low/close price points within lookback, applies volume weighting, then iterates Lloyd's algorithm (kIters passes) to optimize kClusters centroids. Only clusters above minDensity become zones.
Quantile Seeding: Initial centroids placed via quantiles for deterministic, well-spread initialization (more stable than random).
Zone Construction: Each centroid is bounded by ±zoneWidth × ATR and rendered as a box. Resistance/support classification dynamically based on relative position to current price.
7D Feature Extraction: ①Normalized density, ②distance from price (ATR units), ③volatility regime, ④RSI at formation, ⑤BB width, ⑥age, ⑦approach count.
KNN Fortress Classifier: Stores up to maxMemory labeled past samples ("held = 1.0" / "broken = 0.0"). New zones queried via Top-K neighbor search to compute probability scores.
Pending Learning: At break events, features and direction stored in pending arrays. After confirmBars, real outcomes (rejected or continued) determine the label, then added to memory.
Real vs Fake Threshold: Score ≥ realThresh = strong wall (green); ≤ fakeThresh = weak wall (orange); middle = neutral (gray).
Break Detection: Validated when price exceeds breakBuf × ATR with volume above volMult, triggering zone extension display.
⚙️ Recommended Settings & Tuning Guide

Crypto Defaults:

BTC (4H): lookback=150, kClusters=6, refreshN=15, realThresh=0.60
ETH (1H): lookback=120, kClusters=5, refreshN=10, fakeThresh=0.40
SOL/XRP (15M): lookback=100, kClusters=5, refreshN=8, breakBuf=0.15
Long-Term (1D): lookback=300, kClusters=8, refreshN=20, minDensity=6
Parameter Tuning:

Too many zones: Reduce kClusters to 4, raise minDensity to 6
Too few zones: Expand lookback to 200, lower minDensity to 3
Choppy markets: Raise fakeThresh to 0.45 and breakBuf to 0.20
Strong trends: Lower realThresh to 0.50 for early genuine break capture
Faster learning: Shorten confirmBars to 3 (higher mislabel risk)
Conservative learning: Set confirmBars=10 for high-confidence labels only

💡 How to Use in Practice

Strong Wall Reversal: Counter-trade tags on green strong walls
True Breakout Follow: Break of a strong wall = high-conviction trend start
Weak Wall Trap Avoidance: Skip breaks on orange walls, prepare reversal entries
Double Wall Strategy: Consecutive strong walls form a fortress S/R cluster
Multi-Timeframe: Use 1D strong walls as precision entry zones on 1H
AetherEdge Combinations: Overlap with AI Trendline Architect's top-scored lines = elite zone

⚠️ Important Notes

KNN memory requires 30–50 initial samples for reliable scores
Memory and stats reset on indicator reload
Too-small refreshN causes flickering zone updates
Flash crashes or gaps can distort density measurements
K-Means operates on 1D price space — extreme outliers may bias clustering

🚨 Disclaimer

This indicator is provided for educational and research purposes only and does not constitute financial advice. AI classifications and probability scores 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.

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.