veryfid

Kernel Regression Toolkit

This toolkit provides filters and extra functionality for non-repainting Nadaraya-Watson estimator implementations made by @jdehorty. For the sake of ease I have nicknamed it "kreg". Filters include a smoothing formula and zero lag formula. The purpose of this script is to help traders test, experiment and develop different regression lines. Regression lines are best used as trend lines and can be an invaluable asset for quickly locating first pullbacks and breaks of trends.
Other features include two J lines and a blend line. J lines are featured in tools like Stochastic KDJ. The formula uses the distance between K and D lines to make the J line. The blend line adds the ability to blend two lines together. This can be useful for several tasks including finding a center/median line between two lines or for blending in the characteristics of a different line. Default is set to 50 which is a 50% blend of the two lines. This can be increased and decreased to taste. This tool can be overlaid on the chart or on top of another indicator if you set the source. It can even be moved into its own window to create a unique oscillator based on whatever sources you feed it.

Below are the standard settings for the kernel estimation as documented by @jdehorty:
Lookback Window: The number of bars used for the estimation. This is a sliding value that represents the most recent historical bars. Recommended range: 3-50

Weighting: Relative weighting of time frames. As this value approaches zero, the longer time frames will exert more influence on the estimation. As this value approaches infinity, the behavior of the Rational Quadratic Kernel will become identical to the Gaussian kernel. Recommended range: 0.25-25

Level: Bar index on which to start regression. Controls how tightly fit the kernel estimate is to the data. Smaller values are a tighter fit. Larger values are a looser fit. Recommended range: 2-25

Lag: Lag for crossover detection. Lower values result in earlier crossovers. Recommended range: 1-2

For more information on this technique refer to to the original open source indicator by @jdehorty located here:

Script de código aberto

Dentro do verdadeiro espírito TradingView, o autor deste script publicou ele como um script de código aberto, para que os traders possam compreender e checar ele. Um viva ao autor! Você pode usá-lo gratuitamente, mas a reutilização deste código em uma publicação é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Aviso legal

As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.

Quer usar esse script no gráfico?