DocsMathStatisticsQ3 (Third Quartile)

Q3 (Third Quartile)

Windowed · default period 20Statistics

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

NameTypeDefaultDescription
periodnumber20Rolling window size.

Inputs & Outputs

PortTypeDescription
Inputs
inputnumber[]Source numeric array
Outputs
valuesnumber | nullComputed value at each bar; null before the warmup period completes
timestampsnumber[]Bar timestamps (UNIX ms), aligned 1-to-1 with values
Live mode: In live streaming mode the node updates only the last bar in-place rather than recalculating the full array, keeping CPU usage minimal during real-time data feeds.

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.