FractalTrade_

Nadaraya-Watson Oscillator

This indicator is based on the work of @jdehorty and his amazing Nadaraya-Watson Kernel Envelope, which you can see here:

General Description

The Nadaraya-Watson Oscillator (NWO) will give the same information as the Nadaraya-Watson Envelope, but as an oscillator off the main chart, by plotting the relationship between price and the Kernel and its bands. This also means that we can now detect divergences between price and the NWO.

You can see the relationship between the two here:

You can think of this indicator as the kernel envelope version of a Bollinger Band %B. In ranging markets the bands are perfect for mean reversion trades, but in certain situations the break of one of the bands can signal the beggining of a strong trend and price will remain close to the bands for a long period and will only give small pullbacks. As with any indicator, confluence with price and other tools must be taken into account.

Main Features

As with @jdehorty 's Envelope, you can change the following settings:
  • Lookback Window.
  • Relative Weighting.
  • The initial bar for the regression.
  • ATR period for the bands.
  • Inner and Outer Multiples for the bands.

I also added the following:
  • A middle band around the Kernel to filter out false crossovers.
  • A Hull Moving Average to smoothen out the movements of the oscillator and give extra confirmation of turnover points.

Colors

Some special things to note regarding the coloring:
  • The zero line features a gradient that changes color every time the Kernel slope changes direction.
  • The Oscillator plot has a gradient coloring that gets stronger the closer it gets to each of the bands.
  • Every time the oscillator crosses over/under the outer bands the background will be highlighted.

Happy trading!

@FractalTrade_
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?