OPEN-SOURCE SCRIPT

Kernel Switch

Por erdas0
Atualizado
The indicator uses different kernel regression functions and filters to analyze and smooth the price data. It incorporates various technical analysis features like moving averages, ATR-based channels, and the Kalman filter to generate buy and sell signals. The purpose of this indicator is to help traders identify trends, reversals, and potential trade entry and exit points.

Key Components and Functionalities:

Kernel and Filter Selection:
Kernel: Options include RationalQuadratic, Gaussian, Periodic, and LocallyPeriodic.
Filter: Options include No Filter, Smooth, and Zero Lag.
Source: The source data for the calculations (default is close).
Lookback Period: The lookback period for the kernel calculations.
Relative Weight: Used for RationalQuadratic kernel.
Start at Bar: The starting bar index for the calculations.
Period: Used for Periodic and LocallyPeriodic kernels.

Additional Calculations:
Multiplier: Option to apply a multiplier to the kernel output.
Smoothing: Option to apply EMA smoothing to the kernel output.
Kalman Filter: Option to apply a Kalman filter to the smoothed output.
ATR Length: The length of the ATR used for calculating upper and lower bands.

Kernel Regression:
The code uses a switch statement to select and apply the chosen kernel function with the specified parameters.

Kalman Filter:
A custom function to apply a Kalman filter to the kernel output, providing additional smoothing and trend estimation.

ATR-based Channels:
Upper and lower bands are calculated using the kernel output and ATR, adjusted by a multiplier.

Buy/Sell Signals:
Buy signals are generated when the kernel output crosses above its previous value.
Sell signals are generated when the kernel output crosses below its previous value.

Plotting:
The main kernel output is plotted with color changes based on its direction (green for up, red for down).
Upper and lower bands are plotted based on the ATR-adjusted kernel output.
Buy and sell signals are marked on the chart with labels.
Additional markers are plotted when the high crosses above the upper band and the low crosses below the lower band.

Usage:
This indicator is used to analyze and smooth price data using various kernel regression functions and filters. It helps traders identify trends and potential reversal points, providing visual signals for buy and sell opportunities. By incorporating ATR-based channels and the Kalman filter, the indicator offers additional insights into price movements and volatility. Traders can customize the parameters to fit their specific trading strategies and preferences.

Important Note:
This script is provided for educational and template purposes and does not constitute financial advice. Traders and investors should conduct their research and analysis before making any trading decisions.
Notas de Lançamento
-Band calculation changed
-Added smoothing methods. (McGinley, EMA, SMA, RMA,HMA)
Notas de Lançamento
-Added new smooting method. (WMA)
Bands and Channelseducational

Script de código aberto

No verdadeiro espírito do TradingView, o autor desse script o publicou como código aberto, para que os traders possam compreendê-lo e analisá-lo. Parabéns ao autor! Você pode usá-lo gratuitamente, mas a reutilização desse código em publicações é regida pelas Regras da Casa. Você pode favoritá-lo para usá-lo em um gráfico.

Quer usar esse script no gráfico?

Aviso legal