Nadaraya Watson Envelope
How to use, trade and calculate the Nadaraya Watson Envelope
How to use, trade and calculate the Nadaraya Watson Envelope
These indicators and concepts are specifically designed for TradingView.com
The Nadaraya-Watson Envelope is a technical indicator that is used to estimate the upper and lower bounds of a trading range. It is named after two statisticians, K. G. Nadaraya and G. Watson, who developed the algorithm for non-parametric regression analysis.
We use the envelope as a mean reversion signal. When the price of the security is above the upper envelope, it may be overbought, and when the price is below the lower envelope, it may be oversold. A buy signal is generated when the price crosses below the lower envelope, and a sell signal is generated when the price crosses above the upper envelope. This is because the upper and lower bands are primarily based on the highest and lowest price extremes.
Nadaraya Watson Envelope
This is one of the most complex formulas to comprehend so an overview of calculation will be provided, but here is the process of calculation:
Now for the formula:
Regression line:
h(t) = Σw(i,t)p(i) / Σw(i,t)
where:h(t) = the regression line at time tw(i,t) = the weight assigned to data point i at time t based on the kernel function and bandwidth parameter p(i) = the price data point at time i
Upper envelope:
U(t) = h(t) + k*σ
where:U(t) = the upper envelope at time th(t) = the regression line at time tk = the number of standard deviations from the regression line to the upper envelope (can be chosen based on volatility or backtesting)σ = the standard deviation of the price data over a certain time period (can be chosen based on volatility or backtesting)
Lower envelope:
L(t) = h(t) - k*σ
where:L(t) = the lower envelope at time th(t) = the regression line at time tk = the number of standard deviations from the regression line to the lower envelope (can be chosen based on volatility or backtesting)σ = the standard deviation of the price data over a certain time period (can be chosen based on volatility or backtesting)
The kernel regression method uses a kernel function to assign weights to the data points based on their distance from the regression point. The bandwidth parameter controls the degree of smoothing of the regression line, with a larger bandwidth resulting in a smoother line and a smaller bandwidth resulting in a more volatile line.