ScriptingReferenceFunctionstalibtalib.percentile_nearest_rank

talib.percentile_nearest_rank

Takes the requested percentile of source over length bars at the nearest rank, without interpolating. The result is therefore one of the values in the window. Where you would rather have a smoother figure, use the linear-interpolation function.

talib.percentile_nearest_rank(series float source, series int length, series float percentile) → series float
ParameterTypeRequiredDescription
sourceseries floatyesThe series to take the percentile of.
lengthseries intyesHow many bars the window covers.
percentileseries floatyesThe percentile wanted. Int or float.

Returns series float — A series float.

indicator("75th percentile, nearest rank")
plot(talib.percentile_nearest_rank(close, 20, 75))

See also talib.alma · talib.atr · talib.barssince

Part of the function index.

Ready to put this into practice?
Try GoCharting Premium
Unlock advanced orderflow, market profile, options desk, and real-time data — everything you just read about, live in your charts.
Upgrade