OPEN-SOURCE SCRIPT

AetherEdge Cluster Probability Line

275
🖊️ Overview
AetherEdge Cluster Probability Line fuses K-means clustering with Markov-style state transition probabilities to deliver a next-generation probabilistic direction forecasting engine. It automatically classifies market behavior into three regimes (bearish, neutral, bullish) and computes the probability of the next state from learned historical transitions — projecting a forward-looking prediction line that reveals the market's hidden statistical bias.

🔶 Key Features

K-means Auto-Clustering: Dynamically classifies price behavior into 3 regimes
Transition Probability Matrix: 3×3 Markov-style matrix estimates next-state odds
2D Feature Space: Custom momentum × range expansion features
Forward Projection Line: Visualizes directional bias N bars ahead
5-Tier Color Gradient: Intuitive visualization of strength and direction
Probability Label: Minimalist confidence percentage with directional arrow
Bullish/Bearish Alerts: High-conviction signal notifications
🧠 Technical Architecture
This indicator is built on a unique fusion of K-means clustering × Markov transition probabilities.

Feature Engineering: ATR-normalized momentum and SMA-based range expansion are smoothed with 3-period EMA, producing a regime-agnostic 2D feature vector.
K-means Implementation: lookback bars are partitioned into 3 clusters, with centroids (c1, c2, c3) converging through up to iterMax iterations to extract the market's natural state structure.
Transition Matrix: Counts cluster transitions between consecutive bars and normalizes into a 3×3 matrix, statistically learning "which state is most likely next from current state."
Current State Detection: The latest feature vector's nearest centroid determines the current cluster ID.
Bias Calculation: bias = (P→Bull − P→Bear) × sensitivity gives net direction, while confidence captures conviction.
Forward Projection: close + bias × ATR × forwardN projects future price on an ATR scale, rendered as a directional line.
⚙️ Recommended Settings & Tuning Guide

Crypto Defaults:

BTC/ETH (4H–1D): Lookback=100, Forward=8, Sensitivity=1.0
SOL/XRP (1H): Lookback=80, Forward=6, Sensitivity=1.2 (high volatility)
Scalping (5M–15M): Lookback=50, Forward=4, Feature Smoothing=8
Long Swing (1D–1W): Lookback=200, Forward=12, Sensitivity=0.8
Tuning Tips:

Choppy predictions: Raise Feature Smoothing to 20–30 to reduce noise
Sluggish response: Sensitivity to 1.5–2.0, Iterations to 12+
Ranging markets: Shorter Forward Bars (3–5) for near-term focus
Trending markets: Longer Forward Bars (10–15) for big-picture view
💡 How to Use in Practice

Bias Confirmation: Strong color + high confidence (>55%) confirms directional bias
Entry Timing: Use slope flips of the prediction line as early signals
Multi-Timeframe: HTF (4H) line for macro bias → LTF (15M) for precise entries
AetherEdge Combinations: Liquidity Sentinel sweep + matching Cluster Line direction = elite conviction
Risk Management: Stand aside when confidence <0.5; engage aggressively at >0.6
⚠️ Important Notes

K-means runs only on barstate.islast — historical bars are not rendered (real-time-focused design)
Clustering accuracy is unstable below the initial lookback bars
The prediction line represents statistical tendency, not deterministic future
Sudden regime shifts may require time for the transition matrix to relearn
🚨 Disclaimer
This indicator is provided for educational and research purposes only and does not constitute financial advice. All trading decisions are made at your own risk and should be accompanied by proper risk management. Past performance is not indicative of future results.

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.