Contents
- abs
- add
- all_time_high
- all_time_low
- and
- approx
- aroon_down
- aroon_osc
- aroon_up
- atr
- bb_lower
- bb_upper
- bb_width
- cci
- change
- cond
- count
- cross
- crossover
- crossunder
- cumsum
- days_since
- dev
- deviation
- div
- ema
- eq
- falling
- floordiv
- gain
- gt
- gte
- highest
- highest_bars_ago
- hma
- kc_lower
- kc_middle
- kc_upper
- kcw
- loss
- lowest
- lowest_bars_ago
- lt
- lte
- macd_histogram
- macd_line
- macd_signal
- max
- mean
- median
- mfi
- min
- mod
- mom
- months_since
- mul
- ne
- obv
- offset
- or
- pct_change
- percentrank
- pivothigh
- pivotlow
- pow
- range
- rising
- roc
- rsi
- sma
- sqrt
- stdev
- stoch_d
- stoch_k
- streak
- sub
- sum
- swma
- true_range
- universe_percentile
- variance
- vwma
- weeks_since
- wilderma
- williams_r
- wma
- years_since
No matches
universe_percentile
Universe Percentile (cross-stock ranking)
universe_percentile(field)
Parameters
| Name | Type | Description |
|---|---|---|
field |
field | Data series or indicator value to rank across the scanned universe |
Formula
universe_percentile(X) = (number of stocks with value < X) / (N - 1)
Examples
// top 10% by turnover
universe_percentile(turnover) > 0.90;
// top 5% by volume
universe_percentile(volume) >= 0.95;
// top 25% by bar change %
universe_percentile(bar_change_pct) > 0.75;
// top 20% by 20-day SMA
x = sma(close, 20); universe_percentile(x) > 0.80;
Returns
float
Notes
Computed across all stocks in the scanned universe, not per-stock history; raw-field percentiles are optimized to reduce the universe early, before expensive indicator calculations, while indicator-based percentiles like universe_percentile(rsi(close, 14)) require the indicator computed first and cannot be placed early; ties share the same rank