OPEN-SOURCE SCRIPT

Kernel Switch

已更新
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.
版本注释
-Band calculation changed
-Added smoothing methods. (McGinley, EMA, SMA, RMA,HMA)
版本注释
-Added new smooting method. (WMA)
Bands and Channelseducational

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?

免责声明