PINE LIBRARY
Zaktualizowano RationalQuadraticKernelFunction

Description:
An optimised library for non-repainting Rational Quadratic Kernel Library. Added lookbackperiod and a validation to prevent division by zero.
Thanks to original author jdehorty.
Usage:
1. Import the library into your Pine Script code using the library function.
Pine Script®
2. Call the Main Function:
Use the rationalQuadraticKernel function to calculate the Rational Quadratic Kernel estimate.
Provide the following parameters:
3. Plot the Estimate:
Plot the resulting estimate on your TradingView chart using the plot function.
Pine Script®
Parameter Explanation:
Example Usage:
Here's an example of how to use the library to calculate and plot the Rational Quadratic Kernel estimate for the 'close' price series:
Pine Script®
This example calculates the estimate for the 'close' price series, considers the previous 11 bars, assigns equal weight to all data points, and starts the calculation from the 24th bar. The result is plotted as an orange line on the chart.
Highly recommend to customize the parameters to suit your analysis needs and adapt the library to your trading strategies.
An optimised library for non-repainting Rational Quadratic Kernel Library. Added lookbackperiod and a validation to prevent division by zero.
Thanks to original author jdehorty.
Usage:
1. Import the library into your Pine Script code using the library function.
2. Call the Main Function:
Use the rationalQuadraticKernel function to calculate the Rational Quadratic Kernel estimate.
Provide the following parameters:
- `_src` (series float): The input series of float values, typically representing price data.
- `_lookback` (simple int): The lookback period for the kernel calculation (an integer).
- `_relativeWeight` (simple float): The relative weight factor for the kernel (a float).
- `startAtBar` (simple int): The bar index to start the calculation from (an integer).
- rationalQuadraticEstimate = rationalQuadraticKernel(_src, _lookback, _relativeWeight, startAtBar)
3. Plot the Estimate:
Plot the resulting estimate on your TradingView chart using the plot function.
Parameter Explanation:
- `_src`: The input series of price data, such as 'close' or any other relevant data.
- `_lookback`: The number of previous bars to consider when calculating the estimate. Higher values capture longer-term trends.
- `_relativeWeight`: A factor that controls the importance of each data point in the calculation. A higher value emphasizes recent data.
- `startAtBar`: The bar index from which the calculation begins.
Example Usage:
Here's an example of how to use the library to calculate and plot the Rational Quadratic Kernel estimate for the 'close' price series:
This example calculates the estimate for the 'close' price series, considers the previous 11 bars, assigns equal weight to all data points, and starts the calculation from the 24th bar. The result is plotted as an orange line on the chart.
Highly recommend to customize the parameters to suit your analysis needs and adapt the library to your trading strategies.
Informacje o Wersji
v2Change log:
- Removed Starting window
- The size is determined based on a user-defined value, providing greater flexibility in managing the data for the bars, with the possibility of exceeding the value 2000 if necessary.
removed few variables
rationalQuadraticKernel(src, lookback, relativeWeight)
Parameters:
src (float)
lookback (simple int)
relativeWeight (simple float)
Informacje o Wersji
v3Change log:
- Removed default plot (to avoid during importing into indicator)
- Updated an example with full implementation of library.
Example:
Biblioteka Pine
W zgodzie z duchem TradingView autor opublikował ten kod Pine jako bibliotekę open-source, aby inni programiści Pine z naszej społeczności mogli go ponownie wykorzystać. Ukłony dla autora. Można korzystać z tej biblioteki prywatnie lub w innych publikacjach open-source, jednak ponowne wykorzystanie tego kodu w publikacjach podlega Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.
Biblioteka Pine
W zgodzie z duchem TradingView autor opublikował ten kod Pine jako bibliotekę open-source, aby inni programiści Pine z naszej społeczności mogli go ponownie wykorzystać. Ukłony dla autora. Można korzystać z tej biblioteki prywatnie lub w innych publikacjach open-source, jednak ponowne wykorzystanie tego kodu w publikacjach podlega Zasadom serwisu.
Wyłączenie odpowiedzialności
Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.