ta.percentile_linear_interpolation()
Percentile (Linear Interpolation)
Calculates the percentile using linear interpolation between the two nearest ranks.
Syntax
ta.percentile_linear_interpolation(source, length, percentage) → series floatArguments
| Parameter | Type | Description |
|---|---|---|
| source | series int/float | Series of values to process. |
| length | series int | Number of bars in the rolling window. |
| percentage | simple int/float | Target percentile in the 0-100 range. |
Returns
P-th percentile of source for length bars back using linear interpolation.
Remarks
na values in the source series are ignored.
Code Examples
//@version=6
indicator("percentile_linear_interpolation")
p50 = ta.percentile_linear_interpolation(close, 100, 50)
plot(p50, title="Median-like (50th pct)")Trading Applications
Calculate precise percentile levels for price analysis
Build adaptive bands based on percentile levels
Create dynamic support/resistance from statistical distributions
Use for non-parametric volatility measurement
Related Functions
Frequently Asked Questions
Generate ta.percentile_linear_interpolation() Code with AI
Skip the manual coding. Use Pineify's AI Coding Agent to generate Pine Script code using ta.percentile_linear_interpolation() and other built-in functions instantly.
Related Pine Script Functions
ta.percentile_nearest_rank()
Learn how to use ta.percentile_nearest_rank() in Pine Script. Calculate percentiles using nearest rank method.
ta.percentrank() - Percent Rank
Learn how to use ta.percentrank() in Pine Script. Calculate percentile ranking of current value.
ta.median() - Median
Learn how to use ta.median() in Pine Script. Calculate the median value for robust price analysis.
ta.stdev() - Standard Deviation
Learn how to use ta.stdev() in Pine Script. Syntax, parameters, code examples for statistical standard deviation calculation.
ta.variance() - Variance
Learn how to use ta.variance() in Pine Script. Calculate statistical variance for volatility analysis.