Skip to content
Algo Trade Analytics Docs

ta.percentile_nearest_rank() - Pine Script Function

Calculates percentile using method of Nearest Rank.

ta.percentile_nearest_rank(source, length, percentage) → series float
NameTypeDescription
sourceseries int/floatSeries of values to process (source).

P-th percentile of source series for length bars back.

  • Using the Nearest Rank method on lengths less than 100 bars back can result in the same number being used for more than one percentile.