Q3 (Third Quartile)
The Q3 node returns the 75th percentile of the rolling window using linear interpolation. 75% of all non-null values in the window fall below Q3. Q3 defines the upper bound of the central distribution — useful for detecting when the current value has risen to historically expensive levels. Combined with Q1, it directly produces the IQR spread.
Algorithm
- ▸Sort non-null window values ascending
- ▸p = 75; idx = (p/100) × (n−1)
- ▸lo = floor(idx), hi = ceil(idx)
- ▸output = sorted[lo] + (sorted[hi] − sorted[lo]) × (idx − lo)
- ▸Returns null if no non-null values
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| period | number | 20 | Rolling window size. |
Inputs & Outputs
| Port | Type | Description |
|---|---|---|
| Inputs | ||
| input | number[] | Source numeric array |
| Outputs | ||
| values | number | null | Computed value at each bar; null before the warmup period completes |
| timestamps | number[] | Bar timestamps (UNIX ms), aligned 1-to-1 with values |
Use Cases
Overbought Level
When an oscillator rises to or above its own rolling Q3, it has reached the upper quartile of recent values — a quantile-based overbought signal for mean-reversion strategies.
Upper Fence Construction
Q3 + 1.5 × IQR defines the upper whisker of a box plot — values above this are statistical outliers indicating potentially abnormal price action.
Quantile Channel
Use Q3 as the upper band of a distribution-aware price channel for dynamic resistance, paired with Q1 as the lower band.