PINE LIBRARY
업데이트됨 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.
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.
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:
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.
Pine Script®
import vinayakavajiraya/RationalQuadraticKernelFunction/1
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.
Pine Script®
plot(rationalQuadraticEstimate, color = color.red, title = "Rational Quadratic Kernel Estimate")
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:
Pine Script®
//@version=5
library("RationalQuadraticKernelFunctions", true)
rationalQuadraticEstimate = rationalQuadraticKernel(close, 11, 1, 24)
plot(rationalQuadraticEstimate, color = color.orange, title = "Rational Quadratic Kernel Estimate")
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.
릴리즈 노트
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)
릴리즈 노트
v3Change log:
- Removed default plot (to avoid during importing into indicator)
- Updated an example with full implementation of library.
Example:
Pine Script®
// @version=5
indicator(title="Relational Quadratic Kernel Estimate , shorttitle="RQKE-V", overlay=true, timeframe = "", timeframe_gaps = false)
// Import (latest) external library
import vinayakavajiraya/RationalQuadraticKernelFunction/2 as kernel
// Input parameters for the kernel estimate
length = input.int(title="Lookback Window", defval=10, minval=1, step=1, group="Kernel Estimate", tooltip="The number of previous bars to consider when calculating the rationalQuadraticEstimate. Higher values capture longer-term trends.")
relativeWeight = input.float(title="Relative Weight", defval=8, minval=1, step=1, group="Kernel Estimate", tooltip="A factor that controls the importance of each data point in the calculation. A higher value emphasizes recent data.")
source = input.source(title="Source", defval=close, group="Kernel Estimate"), // Data source (e.g., close price) for the calculation
// Calculate the rational quadratic estimate using the imported library
rationalQuadraticEstimate = kernel.rationalQuadraticKernel(
source, // Data source for calculation
length, // Lookback window
relativeWeight // Relative weight of data points
)
// Plot the rational quadratic estimate on the chart
plot(rationalQuadraticEstimate, color=color.orange, title="Relational Quadratic Estimate")
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
파인 라이브러리
진정한 트레이딩뷰 정신에 따라 작성자는 이 파인 코드를 오픈 소스 라이브러리로 공개하여 커뮤니티의 다른 파인 프로그래머들이 재사용할 수 있도록 했습니다. 작성자에게 건배! 이 라이브러리는 개인적으로 또는 다른 오픈 소스 출판물에서 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰의 적용을 받습니다.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.