Machine Learning: Anchored Gaussian Process Regression
By LuxAlgoNov 2, 2023
Machine Learning: Anchored Gaussian Process Regression is an indicator on Vela, our next-generation charting platform, written in Pine Script®.
Machine Learning: Anchored Gaussian Process Regression hands you control of the training set: place two anchors on the chart and the model fits a kernel-based regression to the price data between them, drawing the fit as a blue line and extending a red forecast beyond it. Anchoring makes experimentation honest: you can see exactly which regime the estimate learned from and how each setting reshapes the projection.
A faint silver line plots a moving average with the Training Window's length from Anchor 1 onward; at Anchor 2 it equals the window's average price, a simple benchmark for judging how far the forecast deviates from the window's average.
How to Trade the Machine Learning: Anchored Gaussian Process Regression?
- Blue line: the model's fit across the window defined by Anchor 1 and Anchor 2.
- Red line: the forward projection computed from that window, a trend scenario, never a standalone entry trigger.
- Forecast versus mean line: comparing the two shows at a glance how far the projection strays from the window's average price.
- Regime testing: re-anchor across different market phases to compare how your Smooth and Sigma choices hold up.
The Training Window has an internal size cap: anchors set too far apart draw up to the limit and stop, with the red forecast taking priority. Anchor order does not matter: placing Anchor 2 before Anchor 1 works fine.
Machine Learning: Anchored Gaussian Process Regression Settings
- Anchor 1 / Anchor 2: the start and end points of the Training Window.
- Forecasting Length: how many bars ahead the forecast extends.
- Smooth: higher values produce smoother, longer-term trend estimates.
- Sigma: controls noise variance; values near zero increase sensitivity and amplify the forecast.
Frequently Asked Questions
Free to use
Run it on Vela. Go further with a paid plan.
- Up to 500 strategy alerts, with webhook automation
- Up to 10× the chart history of Free
- Orderflow lookback up to full history
- More Quant usage to customize it, plus extra usage when you need it
- Futures data alongside crypto, stocks, forex and commodities
Also works on
Related indicators
Run it on Vela. Make it yours with Quant.
Open this indicator free on Vela, our next-generation charting platform. Then ask Quant, our coding agent built into Vela, to retune it or turn it into a backtested strategy of your own.





