Lowest and highest values over a specified period (MINMAX)
Summary
Returns both the lowest and highest values of the input over a rolling window of the last optInTimePeriod bars. An overlap-study companion to MIN and MAX that computes both extrema in one pass.
Formula
outMin[i] = min(inReal[i-optInTimePeriod+1 .. i])
outMax[i] = max(inReal[i-optInTimePeriod+1 .. i])
Inputs
inReal— Values scanned for the window min and max
Outputs
outMin— Lowest value in each rolling windowoutMax— Highest value in each rolling window
Parameters
| Parameter | Type | Default | Accepted values | Description |
|---|---|---|---|---|
optInTimePeriod | integer | 30 | 2–100000 | Rolling window length |
Properties
Numerical Stability: Start-Independent
| ✅ Overlap Input i |
| ☐ Independent Y-Axis |
| ☐ Candlestick |
| ☐ Can Output NaN or ±Inf |
| ☐ Identity at Period 1 |
Implementation
TA-Lib Definition: minmax.c · minmax.yaml
| Native | File |
|---|---|
| C | ta_MINMAX.c |
| Rust | minmax.rs |
| Java | Core_MINMAX.java |
TA-Lib is also available for Python, R and more using a wrapper.
Aliases
Highest Lowest
See Also
MIN · MAX · MINMAXINDEX · MININDEX · MAXINDEX