TradingView
jdehorty
2022年10月31日早上7點54分

Nadaraya-Watson: Envelope (Non-Repainting) 

Ethereum / TetherKuCoin

描述

Due to popular request, this is an envelope implementation of my non-repainting Nadaraya-Watson indicator using the Rational Quadratic Kernel. For more information on this implementation, please refer to the original indicator located here:
tradingview.com/v/AWNvbPRM/

What is an Envelope?
In technical analysis, an "envelope" typically refers to a pair of upper and lower bounds that surrounds price action to help characterize extreme overbought and oversold conditions. Envelopes are often derived from a simple moving average (SMA) and are placed at a predefined distance above and below the SMA from which they were generated. However, envelopes do not necessarily need to be derived from a moving average; they can be derived from any estimator, including a kernel estimator such as Nadaraya-Watson.

How to use this indicator?
Overall, this indicator offers a high degree of flexibility, and the location of the envelope's bands can be adjusted by (1) tweaking the parameters for the Rational Quadratic Kernel and (2) adjusting the lookback window for the custom ATR calculation. In a trending market, it is often helpful to use the Nadaraya-Watson estimate line as a floating SR and/or reversal zone. In a ranging market, it is often more convenient to use the two Upper Bands and two Lower Bands as reversal zones.

How are the Upper and Lower bounds calculated?
In this indicator, the Rational Quadratic (RQ) Kernel estimates the price value at each bar in a user-defined lookback window. From this estimation, the upper and lower bounds of the envelope are calculated based on a custom ATR calculated from the kernel estimations for the high, low, and close series, respectively. These calculations are then scaled against a user-defined multiplier, which can be used to further customize the Upper and Lower bounds for a given chart.

How to use Kernel Estimations like this for other indicators?
Kernel Functions are highly underrated, and when calibrated correctly, they have the potential to provide more value than any mundane moving average. For those interested in using non-repainting Kernel Estimations for technical analysis, I have written a Kernel Functions library that makes it easy to access various well-known kernel functions quickly. The Rational Quadratic Kernel is used in this implementation, but one can conveniently swap out other kernels from the library by modifying only a single line of code. For more details and usage examples, please refer to the Kernel Functions library located here:
tradingview.com/script/e0Ek9x99-KernelFunctions/
評論
veryfid
Love your work!
jdehorty
@veryfid Back at you! Thanks again for your constant support.
UnknownUnicorn16043985
Awesome
ca99
Thank you so much!! This is insane!
thomsonraja
If using Lookback Window "2"
Relative Weighting "8"
Start Regression at Bar "5"
Gives approximate similar value with...
script/LSZjbxU6-Adaptive-JMA/ using period "2"
jdehorty
@thomsonraja Interesting, thanks for sharing. Combining this estimator with other Jurik-like Moving Averages (like the one you referenced) or Ehler's MEF makes for interesting crossover-based strategies.
Orph5781
@jdehorty, hi man! wonderful estimator! is it possible that some near future day you create the pinescript for the strategy you suggest, mixing this estimator with some JMA and Ehlers MEF? thanks in advance
meddymarkusvanhala
great stuff as usual
thank you for the time and effort
v3j3v
Could you do same for estimator too and combine them together?
jdehorty
@v3j3v, How do you mean? This indicator already has the estimator combined with it; I import it on line 12 in the code and use it in lines 34-36. The entire indicator is based on the estimator.
更多