# The Echo Forecast

The Echo Forecast is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

A forecasting tool that scans history for the window most correlated, or deliberately most dissimilar, to recent price action and replays that window's own bar-to-bar changes forward from the latest bar. Reference, match, and forecast are all drawn on the chart, with cumulative, mean, or linear-regression construction modes. Sharpest on detrended, periodic series such as oscillators.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Oct 4, 2021.
- Access: free.
- Concepts: [kNN Analog Forecasting](https://www.luxalgo.com/library/concept/knn-analog-forecasting/) (primary), [Correlation](https://www.luxalgo.com/library/concept/correlation/)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=cmpwn6i6g0097vhsgttws3uc0
- Page: https://www.luxalgo.com/library/indicator/the-echo-forecast/

**The Echo Forecast** brings [analog forecasting](https://www.luxalgo.com/library/concept/knn-analog-forecasting/) to the chart: it searches past data for the window whose values best correlate with (or, in dissimilar mode, least correlate with) the latest ones, then replays that matched window's own bar-to-bar changes forward from the latest bar. Similarity is scored with [correlation](https://www.luxalgo.com/library/concept/correlation/) coefficients, a choice well suited to periodic series, and every ingredient of the forecast is drawn on the chart so nothing about it is a black box.

## How to Trade The Echo Forecast?

- **Orange segment**: the benchmark window of recent price action the search tries to match.
- **Green segment**: the best-matching (or most dissimilar) historical window, located inside the gray search zone.
- **Forecast**: the projection built by replaying the matched window's own changes from the latest bar, extended over the forecast horizon.
- **Detrend first**: the method rewards detrended, periodic inputs, such as smooth or momentum oscillators, over raw trending price.

Beyond prediction, the drawing itself is useful: it highlights which stretch of history most resembles the present, a quick way to study how comparable conditions previously resolved.

## The Echo Forecast Settings

- **Evaluation Window**: the window used to hunt for similar or dissimilar history; the total evaluation span combines the Forecast Window and Evaluation Window.
- **Forecast Window**: the forecast's time horizon.
- **Forecast Mode**: match toward similarity or dissimilarity.
- **Forecast Construction**: 'Cumulative' stacks the matched changes onto the latest price, 'Mean' blends them with the benchmark window's average, and 'Linreg' combines them with a linearly extrapolated regression fit.
- **Source**: the series being forecast.

## Frequently Asked Questions

### Why does it work better on detrended data?

Correlation-based matching keys on the shape of fluctuations, and a persistent trend drowns that shape out. Feeding it an oscillator or another detrended, periodic series lets recurring behavior dominate the match, which is the regime this method was designed for.

### What is the point of the dissimilar mode?

It inverts the question and retrieves the historical window least like the present. Contrasting the forecast replayed from a dissimilar window with one replayed from a similar window widens the range of scenarios you can weigh, rather than leaning on a single analog's answer.

### How do I access The Echo Forecast?

It is free on the LuxAlgo Library and can be run or backtested in Quant, our coding agent, right from this page. If you prefer model-fit projections over historical analogs, the [Recursive Least Squares Forecast](https://www.luxalgo.com/library/indicator/recursive-least-squares-forecast/) approaches forecasting from that opposite direction. You can also copy the source code from this page and run it anywhere Pine Script® runs.

## Related indicators

- [Historical Price Projection](https://www.luxalgo.com/library/indicator/historical-price-projection/) (kNN Analog Forecasting): markdown at https://www.luxalgo.com/library/indicator/historical-price-projection.md
- [kNN Market Architecture](https://www.luxalgo.com/library/indicator/knn-market-architecture/) (kNN Analog Forecasting): markdown at https://www.luxalgo.com/library/indicator/knn-market-architecture.md
- [Indicator Configuration Forecasting](https://www.luxalgo.com/library/indicator/indicator-configuration-forecasting/) (kNN Analog Forecasting): markdown at https://www.luxalgo.com/library/indicator/indicator-configuration-forecasting.md
- [KNN Supertrend Horizon](https://www.luxalgo.com/library/indicator/knn-supertrend-horizon/) (kNN Analog Forecasting): markdown at https://www.luxalgo.com/library/indicator/knn-supertrend-horizon.md
- [Neighboring Trailing Stop](https://www.luxalgo.com/library/indicator/neighboring-trailing-stop/) (kNN Analog Forecasting): markdown at https://www.luxalgo.com/library/indicator/neighboring-trailing-stop.md
- [MACD Based Price Forecasting](https://www.luxalgo.com/library/indicator/macd-based-price-forecasting/) (kNN Analog Forecasting): markdown at https://www.luxalgo.com/library/indicator/macd-based-price-forecasting.md
- [Correlation Clusters](https://www.luxalgo.com/library/indicator/correlation-clusters/) (Correlation): markdown at https://www.luxalgo.com/library/indicator/correlation-clusters.md
- [Historical Correlation](https://www.luxalgo.com/library/indicator/historical-correlation/) (Correlation): markdown at https://www.luxalgo.com/library/indicator/historical-correlation.md

---

Source: https://www.luxalgo.com/library/indicator/the-echo-forecast/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
