OPEN-SOURCE SCRIPT
AetherEdge - Gaussian Process Bands

🖊️ Overview
AE-GAUSS models price as a Gaussian Process and draws the predictive mean plus its uncertainty (±1σ, ±2σ) as nested translucent bands — a "fog of probability" that narrows where the model is confident and widens where it isn't. When price punches outside the 2σ band and snaps back, it fires a mean-reversion BUY/SELL as a statistically extreme excursion. It implements Gaussian Process Regression (GPR), a genuine Bayesian machine-learning method, the numerically-stable way without a matrix inverse.
🔶 Key Features
Gaussian Process Regression (GPR): models price as a stochastic process
RBF kernel + Cholesky decomposition: numerically-stable exact GP prediction
Linear detrend: trend-following extrapolation
Uncertainty bands: nested ±1σ / ±2σ "fog"
Volatility-adaptive kernel: σf scaled by ATR so bands breathe
2 signal modes: 2σ excursion reversion, or predictive-mean cross
Fit-quality tracking: online monitoring of prediction error
HUD showing σ-position gauge and z-score
Per-event 2σ excursion and signal alerts
🧠 Technical Architecture
This implements Gaussian Process Regression (GPR). Training is the last N prices; a linear trend is removed by least squares first, the GP models the stationary residual, and the trend is added back to the forecast. The RBF kernel k(i,j) = σf²·exp(−(i−j)²/2ℓ²) builds the N×N covariance K (+ σn² noise on the diagonal). Cholesky K = LLᵀ solves the linear systems K·α = y and K·v = k* by forward/back substitution (avoiding a matrix inverse — numerically stable). At x* = N (current bar), predictive mean μ* = trend + kᵀα and variance σ² = σf² − kᵀv. σf is ATR-scaled so band width changes with volatility. z-score = (close − μ)/σ* measures the statistical position. Signals fire when price exits the ±2σ band and re-enters, or crosses the predictive mean. GP computation runs on confirmed bars only.
⚙️ Recommended Settings & Tuning Guide
Training Points (N) 16 is a starting point — cost is O(N³), keep modest; lower if your chart lags (min 6). Length Scale (ℓ) 5 is RBF smoothness in bars — larger is smoother and longer-memory, smaller is local and reactive. Signal Amplitude 1.0×ATR is kernel signal std σf, setting the band's vertical scale. Observation Noise 0.4×ATR is σn — higher gives a smoother mean, wider bands, more tolerance. Signal Mode "2σ reversion" is mean-reverting; "Mean cross" is more trend-following.
💡 How to Use in Practice
Apply to chart and fog-like uncertainty bands appear around the predictive mean. Narrow bands mean the model confidently predicts price; wide bands mean uncertainty. When price punches through the lower 2σ band it's a statistically rare oversold — buy on the re-entry. Vice versa above. The HUD's "price σ-position" gauge shows where price sits in the prediction (● position), and the z-score shows how many σ it deviates. Smaller "fit error" means the model fits well, raising signal reliability. Raising length scale gives smooth swing bands; lowering gives reactive ones. In trends the predictive mean follows the trend; in ranges band-edge reversions work.
⚠️ Important Notes
GPR is a genuine machine-learning method (Bayesian non-parametric regression). To stay inside Pine's compute budget, N is kept small and the kernel hyper-parameters (ℓ, σf, σn) are user-set (with ATR scaling), not marginal-likelihood-optimized. The GP math, however, is exact for the chosen N. This indicator is the most compute-heavy of the set, O(N³) per bar; lower N if your chart is slow. GP computation runs on confirmed bars only and does not repaint, but real-time bars show the last confirmed value. All signals are probabilistic decisions based on historical data and do not guarantee future profits.
🚨 Disclaimer
This indicator is provided for educational and informational purposes only and does not constitute financial or investment advice. No signal guarantees future profit, and past performance does not indicate future results. All trading decisions are made at your own risk.
AE-GAUSS models price as a Gaussian Process and draws the predictive mean plus its uncertainty (±1σ, ±2σ) as nested translucent bands — a "fog of probability" that narrows where the model is confident and widens where it isn't. When price punches outside the 2σ band and snaps back, it fires a mean-reversion BUY/SELL as a statistically extreme excursion. It implements Gaussian Process Regression (GPR), a genuine Bayesian machine-learning method, the numerically-stable way without a matrix inverse.
🔶 Key Features
Gaussian Process Regression (GPR): models price as a stochastic process
RBF kernel + Cholesky decomposition: numerically-stable exact GP prediction
Linear detrend: trend-following extrapolation
Uncertainty bands: nested ±1σ / ±2σ "fog"
Volatility-adaptive kernel: σf scaled by ATR so bands breathe
2 signal modes: 2σ excursion reversion, or predictive-mean cross
Fit-quality tracking: online monitoring of prediction error
HUD showing σ-position gauge and z-score
Per-event 2σ excursion and signal alerts
🧠 Technical Architecture
This implements Gaussian Process Regression (GPR). Training is the last N prices; a linear trend is removed by least squares first, the GP models the stationary residual, and the trend is added back to the forecast. The RBF kernel k(i,j) = σf²·exp(−(i−j)²/2ℓ²) builds the N×N covariance K (+ σn² noise on the diagonal). Cholesky K = LLᵀ solves the linear systems K·α = y and K·v = k* by forward/back substitution (avoiding a matrix inverse — numerically stable). At x* = N (current bar), predictive mean μ* = trend + kᵀα and variance σ² = σf² − kᵀv. σf is ATR-scaled so band width changes with volatility. z-score = (close − μ)/σ* measures the statistical position. Signals fire when price exits the ±2σ band and re-enters, or crosses the predictive mean. GP computation runs on confirmed bars only.
⚙️ Recommended Settings & Tuning Guide
Training Points (N) 16 is a starting point — cost is O(N³), keep modest; lower if your chart lags (min 6). Length Scale (ℓ) 5 is RBF smoothness in bars — larger is smoother and longer-memory, smaller is local and reactive. Signal Amplitude 1.0×ATR is kernel signal std σf, setting the band's vertical scale. Observation Noise 0.4×ATR is σn — higher gives a smoother mean, wider bands, more tolerance. Signal Mode "2σ reversion" is mean-reverting; "Mean cross" is more trend-following.
💡 How to Use in Practice
Apply to chart and fog-like uncertainty bands appear around the predictive mean. Narrow bands mean the model confidently predicts price; wide bands mean uncertainty. When price punches through the lower 2σ band it's a statistically rare oversold — buy on the re-entry. Vice versa above. The HUD's "price σ-position" gauge shows where price sits in the prediction (● position), and the z-score shows how many σ it deviates. Smaller "fit error" means the model fits well, raising signal reliability. Raising length scale gives smooth swing bands; lowering gives reactive ones. In trends the predictive mean follows the trend; in ranges band-edge reversions work.
⚠️ Important Notes
GPR is a genuine machine-learning method (Bayesian non-parametric regression). To stay inside Pine's compute budget, N is kept small and the kernel hyper-parameters (ℓ, σf, σn) are user-set (with ATR scaling), not marginal-likelihood-optimized. The GP math, however, is exact for the chosen N. This indicator is the most compute-heavy of the set, O(N³) per bar; lower N if your chart is slow. GP computation runs on confirmed bars only and does not repaint, but real-time bars show the last confirmed value. All signals are probabilistic decisions based on historical data and do not guarantee future profits.
🚨 Disclaimer
This indicator is provided for educational and informational purposes only and does not constitute financial or investment advice. No signal guarantees future profit, and past performance does not indicate future results. All trading decisions are made at your own risk.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuyla, bu komut dosyasının mimarı, yatırımcıların işlevselliğini inceleyip doğrulayabilmesi için onu açık kaynaklı hale getirdi. Yazarı tebrik ederiz! Ücretsiz olarak kullanabilseniz de, kodu yeniden yayınlamanın Topluluk Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.