OPEN-SOURCE SCRIPT
EdgeXplorer - Gaussian Forecast Grid

EdgeXplorer – Gaussian Forecast Grid
The Gaussian Forecast Grid is a forward-looking market modeling tool that uses a Gaussian Process Regression framework to estimate future price behavior. Built around a non-parametric machine learning approach, it maps recent historical price data to generate smoothed forecasts, offering an evolving yet mathematically grounded projection of where price could be headed.
This is not a “signal generator”—it’s a probabilistic estimation tool that overlays a fitted baseline with a future-facing forecast curve, giving traders visual guidance on short-term trend expectations while accounting for noise and variance in price behavior.
⸻

🔍 What Does the Gaussian Forecast Grid Do?
Gaussian Forecast Grid takes a fixed historical training sample of price data and fits it using a Gaussian kernel, generating two key visual elements:
• Fit Line — a smoothed, mathematically reconstructed version of the past data window
• Forecast Line — a forward-projected estimation of price behavior based on the shape and curvature of the past data
Traders can adjust how sensitive the model is to local volatility, how smooth the prediction curve is, and how frequently the forecast updates.
⸻
⚙️ How It Works – Technical Logic Explained
1. Kernel Regression Foundation
The tool applies a Gaussian kernel function that evaluates similarity between time steps in a defined window. This results in a covariance matrix that models how likely different values are to move together.
kernel(x1, x2) = exp( - (x1 - x2)² / (2 * scale²) )
• X-axis: Time steps
• Y-axis: Price deviations from baseline
• Scale: Smoothing factor (determines how tight or loose the fit is)
2. Training Phase
A fixed number of bars (Data Sample Length) are selected as the training window, from which the tool:
• Computes a baseline average (via SMA)
• Normalizes price deviations
• Builds a covariance matrix for training (with optional noise)
• Inverts the matrix to solve for weights
3. Forecast Generation
With the model trained:
• Future time steps (Projection Steps) are mapped
• The kernel is applied between past and future points
• A projected set of values is generated based on how past structure likely evolves
4. Model Refresh Options
Users can control when the model retrains:
• Lock Forecast: Generates forecast once and holds it
• Update Once Reached: Recomputes after reaching the end of the forecast window
• Continuously Update: Recalculates forecast on every new bar

⸻
📈 What Each Visual Element Represents
Visual Component Meaning
Blue Line (Fit) A smoothed curve fitted to historical price behavior
Red Line (Forecast) Projected price path based on Gaussian inference
Baseline The mean price used to normalize the data
Polyline Split Left = historical fit, Right = projected future
These lines are dynamically drawn and cleared based on model refresh mode, ensuring only relevant and current data is displayed.
⸻
📊 Inputs & Settings Explained
Training Inputs
Setting Description
Data Sample Length How many bars are used to fit the model (higher = smoother, slower)
Fit Color Color for the historical fit curve
Forecast Controls
Setting Description
Projection Steps Number of future bars to forecast
Prediction Color Color of the projected forecast line
Model Behavior
Setting Description
Smoothing Factor Controls the “tightness” of the curve; lower values = more reactive
Noise Scale Adds Gaussian noise to prevent overfitting; useful in high-volatility assets
Model Behavior (Refresh Mode)
• Lock Forecast = static output
• Update Once Reached = refresh after forecast ends
• Continuously Update = live update every bar
⸻
🧠 How to Interpret It in Real Markets
This indicator does not tell you where price is going. Instead, it provides a smoothed probabilistic path based on the recent shape of price movement.
Use Cases:
• 🧭 Price Projection Framing: Align other tools (like OBs, liquidity zones, or support/resistance) within the estimated trajectory
• 🔄 Reversion vs. Continuation: Compare current price position relative to the forecast path to judge whether the market is returning to structure or breaking from it
• 📐 Bias Context: Use forecast slope direction to determine short-term directional bias
⸻
🧪 Strategy Integration Tips
• Pair with a volatility filter to use only when price is ranging or compressing
• Overlay with SMC tools like OB, FVG, or BOS indicators for confirmation
• Use as a visual narrative tool to avoid chasing price blindly during uncertain phases
The Gaussian Forecast Grid is a forward-looking market modeling tool that uses a Gaussian Process Regression framework to estimate future price behavior. Built around a non-parametric machine learning approach, it maps recent historical price data to generate smoothed forecasts, offering an evolving yet mathematically grounded projection of where price could be headed.
This is not a “signal generator”—it’s a probabilistic estimation tool that overlays a fitted baseline with a future-facing forecast curve, giving traders visual guidance on short-term trend expectations while accounting for noise and variance in price behavior.
⸻
🔍 What Does the Gaussian Forecast Grid Do?
Gaussian Forecast Grid takes a fixed historical training sample of price data and fits it using a Gaussian kernel, generating two key visual elements:
• Fit Line — a smoothed, mathematically reconstructed version of the past data window
• Forecast Line — a forward-projected estimation of price behavior based on the shape and curvature of the past data
Traders can adjust how sensitive the model is to local volatility, how smooth the prediction curve is, and how frequently the forecast updates.
⸻
⚙️ How It Works – Technical Logic Explained
1. Kernel Regression Foundation
The tool applies a Gaussian kernel function that evaluates similarity between time steps in a defined window. This results in a covariance matrix that models how likely different values are to move together.
kernel(x1, x2) = exp( - (x1 - x2)² / (2 * scale²) )
• X-axis: Time steps
• Y-axis: Price deviations from baseline
• Scale: Smoothing factor (determines how tight or loose the fit is)
2. Training Phase
A fixed number of bars (Data Sample Length) are selected as the training window, from which the tool:
• Computes a baseline average (via SMA)
• Normalizes price deviations
• Builds a covariance matrix for training (with optional noise)
• Inverts the matrix to solve for weights
3. Forecast Generation
With the model trained:
• Future time steps (Projection Steps) are mapped
• The kernel is applied between past and future points
• A projected set of values is generated based on how past structure likely evolves
4. Model Refresh Options
Users can control when the model retrains:
• Lock Forecast: Generates forecast once and holds it
• Update Once Reached: Recomputes after reaching the end of the forecast window
• Continuously Update: Recalculates forecast on every new bar
⸻
📈 What Each Visual Element Represents
Visual Component Meaning
Blue Line (Fit) A smoothed curve fitted to historical price behavior
Red Line (Forecast) Projected price path based on Gaussian inference
Baseline The mean price used to normalize the data
Polyline Split Left = historical fit, Right = projected future
These lines are dynamically drawn and cleared based on model refresh mode, ensuring only relevant and current data is displayed.
⸻
📊 Inputs & Settings Explained
Training Inputs
Setting Description
Data Sample Length How many bars are used to fit the model (higher = smoother, slower)
Fit Color Color for the historical fit curve
Forecast Controls
Setting Description
Projection Steps Number of future bars to forecast
Prediction Color Color of the projected forecast line
Model Behavior
Setting Description
Smoothing Factor Controls the “tightness” of the curve; lower values = more reactive
Noise Scale Adds Gaussian noise to prevent overfitting; useful in high-volatility assets
Model Behavior (Refresh Mode)
• Lock Forecast = static output
• Update Once Reached = refresh after forecast ends
• Continuously Update = live update every bar
⸻
🧠 How to Interpret It in Real Markets
This indicator does not tell you where price is going. Instead, it provides a smoothed probabilistic path based on the recent shape of price movement.
Use Cases:
• 🧭 Price Projection Framing: Align other tools (like OBs, liquidity zones, or support/resistance) within the estimated trajectory
• 🔄 Reversion vs. Continuation: Compare current price position relative to the forecast path to judge whether the market is returning to structure or breaking from it
• 📐 Bias Context: Use forecast slope direction to determine short-term directional bias
⸻
🧪 Strategy Integration Tips
• Pair with a volatility filter to use only when price is ranging or compressing
• Overlay with SMC tools like OB, FVG, or BOS indicators for confirmation
• Use as a visual narrative tool to avoid chasing price blindly during uncertain phases
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.