Autocorrelation Price Forecasting

Autocorrelation Price Forecasting

1. Introduction

The Autocorrelation Price Forecasting indicator is designed to detect cyclical patterns in financial asset prices and generate a prediction of their likely future movement. It is based on the statistical analysis of price autocorrelation, a fundamental concept in time series theory.

Autocorrelation measures the degree of similarity between a price series and a lagged version of itself over time. When prices show strong autocorrelation, they may be following a repetitive or cyclical pattern that can be leveraged to anticipate future movements. This indicator aims to identify such cycles and, when detected, estimates the future price using a projection based on linear regression applied to recent returns.

The goal is to provide a visual and analytical tool that helps traders spot moments when the market is behaving in a repetitive manner—particularly useful for assets that tend to move in cycles or ranges.

2. How the Indicator Works

The Autocorrelation Price Forecasting indicator operates through several key stages, each serving a distinct analytical function:

a) Manual Pearson correlation calculation

At the core of the indicator is the manual computation of the Pearson correlation coefficient between the current price and a lagged version of it, defined by the length parameter. This is done over a specified analysis window (window). The result is a value between -1 and 1 that indicates the strength of the relationship between both price series.

b) Cycle detection

If the autocorrelation value exceeds a specific threshold, the indicator considers that a meaningful cycle is present in the market, making a prediction viable.

c) Linear regression on returns

When a cycle is detected, the indicator calculates percentage returns and applies linear regression to assess the slope of the return series. This slope reflects the expected direction and strength of the movement.

d) Future price forecasting

Using the calculated slope, the indicator estimates a future price by applying the projected return to the current price. This estimation is drawn on the chart as a line that changes color based on the expected direction (green for bullish, red for bearish).

e) Hypothetical gain/loss

The indicator also computes the hypothetical profit or loss that would result from following the forecast, displaying it in points based on the difference between the current and projected price.

3. Indicator Interpretation

The Autocorrelation Price Forecasting displays a dynamic forecast line on the chart that updates with each new bar. This line provides a clear visual of where the price is expected to go based on detected cycles.

a) Directional signal

  • If the line is above the current price, it suggests a bullish outlook.

  • If the line is below, it suggests a bearish scenario.

b) Line coloring

  • Bright green: Indicates a forecasted upward move.

  • Bright red: Indicates a forecasted downward move.

These visual cues offer immediate insight into the projected trend.

c) On-screen forecast info

When a new bar forms, the indicator shows:

  • Hypothetical gain/loss in points.

  • Future price estimate, rounded to three decimal places.

This information is displayed in a box in the top-right corner of the chart, offering quick access without interfering with price action.

d) Use cases

This indicator can be especially effective in range-bound markets or instruments with seasonal behavior, where cyclical repetition is more common.

4. Indicator Settings

The Autocorrelation Price Forecasting offers three adjustable parameters to tailor it to different assets, timeframes, and trading styles:

a) length (default: 20)

Determines the lag period used in the autocorrelation calculation.

  • Low values: detect short-term cycles.

  • High values: focus on broader, longer-term cycles.

b) window (default: 200)

Specifies the number of bars used for correlation analysis.

  • Short window: more responsive but less stable.

  • Long window: smoother, suited for medium/long-term forecasting.

c) threshold (default: 0.5)

Defines the minimum autocorrelation level required to confirm a cycle.

  • Low threshold: more signals, but potentially noisier.

  • High threshold: fewer, but stronger signals.

Recommendation

Adjust these values based on:

  • Timeframe: longer timeframes may benefit from larger length and window.

  • Asset type: cyclic assets (commodities, indices) are ideal.

  • Trading style: lower threshold for active traders, higher for confirmation-based approaches.

5. Conclusions and Practical Tips

The Autocorrelation Price Forecasting indicator offers an advanced statistical tool to anticipate price movements based on cyclical behavior.

Strengths

  • Statistical rigor: manual Pearson correlation ensures precision.

  • Cycle detection: ideal for seasonal or range-trading environments.

  • Visual clarity: colored prediction line and on-screen info enhance usability.

  • Flexible use: applicable to scalping, swing, or long-term strategies.

Limitations

  • Threshold dependency: incorrect threshold may lead to over- or under-filtering.

  • Not a complete system: best used in conjunction with other tools.

  • Contextual interpretation required: less effective during breakouts or strong trends.

Tips

  • Combine it with support/resistance levels or candlestick patterns.

  • Test multiple length and window values per asset and timeframe.

  • Avoid relying solely on it during trending markets—validate with other methods.

6. ProRealTime Code

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. xpe74 • 7 hours ago #

    Hello it seems the file format does not allow to import the file. At importation stage, an error message pops up saying file format incorrect …

avatar
Register or

Likes

avatar
Related users ' posts
elcortijoverde Gracias Iván,...sigo tus videos en Youtube. Ya estoy con la V12 y se descarga, pero algo est...
elcortijoverde Bueno, ya aparecen las velas, pero ahora, cada fin de vela aparece un nuevo pronóstico y no ...
Roger Gracias por compartir, pero no tengo ninguna predicción. @Ivan @elcortijoverde ¿qué modifica...
ggolfet Hi Actarus, what's the name of the histogram indicator below Apple's chart?
Actaru5 Flag ShowState in setting and show histogram
NicolaSilvagni hi, thank you for creating this indicator. i can't figure out how to get the three graphs b...
Nicolas
6 years ago
Tradingrob Hi Nicolas, i am not that of a coder.. Did you make already a new PRC so we can download the...
Tradingrob Was easier than i thought! thanks! it works now great!
falco44 Bonjour Nicolas, L'indicateur n'affiche rien, peux tu m'aider stp ?
Nicolas Please add a request on forums for any MT4 code conversion, thank you. Follow these easy ste...
mecon I will do so, thank you!
avatar
Anonymous @mecon, did you ever get one?

Top