// @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")