Steversteves

Autoregressive Cloud

Hello,

I am releasing this indicator called the Autoregressive Cloud Indicator.

What it does:

The indicator performs an autoregression analysis on 3 price variables of a ticker, those being the High, the Low and the Close. It uses a 1-lag system and looks back at the previous close, high and low’s effect on the proceeding high, low and close. It then plots out the anticipated range for the ticker based on the autoregression analysis, as well as displays the lag-correlation (autocorrelation) in a table.

What is Autoregression analysis?

Autoregression is a modelling technique used to describe a time series based on its own past values. It assumes that the current value of a variable is a linear combination of its previous values and a random error term.

And what is autocorrelation?

Autocorrelation measures the correlation between a time series and its lagged values. It quantifies the degree to which the current value of a series is related to its past values at different lags, indicating any patterns or dependencies in the data over time. Autoregression and autocorrelation are closely related concepts used to analyze and model time series data.

So how does it work?

The indicator calculates autoregressive values for the close, high, and low prices of a security based on the specified lookback length (which is defaulted to 50). It then plots three sets of clouds representing the smoothed autoregressive values for each price component (done using the SMA function). The transparency of the clouds can be adjusted using the "Transparency" input. Additionally, the code includes a correlation table that displays the correlation coefficients between the lagged values of the close, high, and low prices. The table's position can be customized using the "Position" input.

The indicator defaults to the chart timeframe; however, you can manually adjust the indicator to display the range for whatever timeframe you would like. You can view the 30 minute, 15 or even hourly range on the 1 minute or 5 minute chart if you want.

The indicator will show the anticipated “true trading range” of the stock based on the autoregression and autocorrelation of all 3 variables:


Above is SPY on the 5 minute timeframe with 15 minute levels overlayed. Here, you can see the anticipated trading range for that 15 minute time period.

Using the Correlation Table:

The correlation table displays the Pearson Coefficient for all 3 autoregressions.

A positive correlation: A positive autocorrelation indicates a positive relationship between past and current values of a time series variable. It suggests that when the variable has a high value at a certain time, it is more likely to have a high value in the future, and when it has a low value, it is more likely to have a low value in the future. This positive autocorrelation can imply persistence or trend in the data, indicating that past values can provide useful information for predicting future values. The rule of thumb is anything over 0.5 is considered significant.

A positive correlation among all 3 variables also indicates an uptrend. If you see a strong positive (i.e. the values are all greater than 0.8), it indicates an incredibly decisive and strong uptrend.

A negative correlation: A negative autocorrelation indicates an inverse relationship between past and current values of a time series variable. It suggests that when the variable has a high value at a certain time, it is more likely to have a low value in the future, and vice versa. This negative autocorrelation can imply mean reversion or oscillatory behavior in the data, where extreme values tend to be followed by values closer to the average. It indicates that past values can provide useful information for predicting future values by anticipating a reversal in the direction of the variable. The rule of thumb is anything below or equal to -0.5 is considered significant.
A negative correlation among all 3 variables also indicates a downtrend. If you see a strong negative (i.e. the values are all less than or equal to -0.8), it indicates an incredibly decisive and strong downtrend.

Uses of the Indicator:

The indicator can be used for the following functions:
1. Day trading and scalping within an expected range;
2. Determining the strength or weakness of an uptrend or downtrend on various timeframes;
3. Determining the relationship between previous values and past performance and its effect on future performance;
4. Can alert to changes in trend direction in advance (you may see high, low or close turn negative before others, signifying that weakness is beginning to materialize in an uptrend, or inverse in a downtrend (value changes positive)).

Customizability:

SMA: The autoregression data is smoothed by a 3 period lookback. You can change this if you want, but in order for the indicator to present the true trading range, it is recommended to leave it at <= 3.

Lookback Length: This is the length of the lookback period for the autoregression and autocorrelation functions.

Transparency settings: You can adjust the transparency of the clouds manually.

Timeframe: You can adjust the timeframe, as explained above, to display the timeframe of interest. When you adjust the timeframe, the data will all reflect that timeframe and not necessarily the current TF you have open (i.e. you select 30 minutes while viewing it on the 5 minute, it will show the data for the 30 minute TF period).

Video Tutorial:

I have prepared a video outlining the indicator and also explaining the theory of autoregression/correlation. You can find it below:

Let me know any comments, questions or suggestions below.

Thank you for taking the time to read/watch and check out this indicator.

Safe trades everyone!



Premium indicators and content have launched! Get access at: www.patreon.com/steversteves
开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?