Senzoukria · Indicators

Percentile Rank Indicator: Formula, Settings and How to Read It

Percentile Rank shows where the current close sits within the distribution of the last N closes, on a 0 to 100 scale. A reading of 100 means no other close in the window is above the current one.

Updated September 2026First published 17 September 2026

On this page
  1. What Percentile Rank measures
  2. The formula, as implemented
  3. How to read it
  4. Parameters and defaults
  5. What it does not show
  6. Related indicators
  7. This page in other languages
  8. Frequently asked questions

Percentile Rank — Momentum, in its own panel below the chart.

What Percentile Rank measures

The calculation counts how many closes in the window are less than or equal to the current close, excluding the current bar from the count, and divides by N minus one. The window includes the current bar even though that bar is not counted, so this period corresponds to a length of N minus one in TradingView's ta.percentrank - a documented one-bar offset worth knowing when comparing charts. Using less-than-or-equal means ties count in favour of the current bar, so a completely flat window returns 100 rather than 50; that is an exact result, since every other close really is less than or equal to the current one. The default period is 100, because a rank needs a long memory before it describes anything.

The formula, as implemented

This is not how the indicator is usually defined elsewhere — it is what the shipped code computes, documented next to the implementation:

Rang percentile du close dans la fenêtre des N dernières barres, 0..100 : rank = 100 · #{ j ≠ i dans la fenêtre : close_j ≤ close_i } / (N−1) Convention « ≤ » (les égalités comptent), celle de `ta.percentrank` de TradingView ; la fenêtre inclut la barre courante, qui est exclue du comptage — notre N vaut donc le `length` + 1 de TradingView, écart documenté. Conséquence assumée de la règle « ≤ » : une fenêtre PLATE rend 100, pas 50 — c'est une valeur EXACTE (tous les autres closes sont bien ≤ au courant), pas un 0/0 déguisé ; le dénominateur N−1 est ≥ 1 par le garde-fou min=2. Défaut N=100 (un rang percentile a besoin d'une longue mémoire pour dire quelque chose). Warm-up → null.

How to read it

  • The reading is ordinal: it tells you how many closes the current one exceeded, never by how much.
  • A move to 100 means a new highest close within the window, whether it cleared the previous high by one tick or by a large gap.
  • A reading drifting upward while price stalls means older, higher closes are rolling out of the window - the rank changed without the price changing.
  • Mid-range values around 50 describe a close sitting near the middle of its recent distribution, which is a statement about the window's shape, not about direction.
  • On instruments that trade at the same price for long stretches, ties push the rank toward the top, so check the raw price series before reading 100 as an extension.

Parameters and defaults

Period defaults to 100 and accepts 2 to 2000. Short windows make the rank flip between 0 and 100 on almost every swing, since only a few closes have to be exceeded; at the minimum of 2 the reading can only be 0 or 100. Long windows produce a slow-moving line that reaches the extremes only on a genuine multi-window high or low.

Percentile Rank — parameters exposed in the app, with the values it ships with.
ParameterTypeDefaultRange
Periodnumber1002 – 2000

What it does not show

A rank discards magnitude entirely, which is its strength and its blind spot: a one-tick new high and a large breakout both read 100. It is also sensitive to what leaves the window - an old extreme rolling off changes the rank with no new price action at all. The measure uses closes only, so intrabar highs, lows and ranges are invisible, and neither volume nor the aggressor side reaches it. Finally, ties are resolved in favour of the current bar, which biases readings upward on instruments with many repeated closes.

Browse all indicators

This page in other languages

Frequently asked questions

What does a percentile rank of 100 mean on a price chart?
It means no other close in the lookback window is higher than the current close. Because ties count in favour of the current bar, a window in which every close is identical also returns 100. The reading says the current close is at the top of its recent distribution, not how far above the rest it sits.
Why is the percentile rank period one bar longer than in TradingView?
The window here includes the current bar but excludes it from the comparison count, so an N-bar setting compares the current close against N minus one others. TradingView's ta.percentrank defines its length as the number of bars being compared, so the same calculation uses a value one smaller there.
Is percentile rank the same as a stochastic oscillator?
No. A stochastic measures the distance from the current price to the window's low as a fraction of the window's range, so it reflects magnitude. Percentile rank counts how many closes the current one exceeds, so it reflects order only - two very different price distributions can produce the same rank.
NEXT

Keep reading