MIDPRICE
MIDPRICE
Summary
Midpoint of the price range over a rolling window: the average of the highest high and lowest low across the last optInTimePeriod bars. An overlap-study line plotted on price.
Formula
MIDPRICE = (Highest(High, N) + Lowest(Low, N)) / 2, over the N=optInTimePeriod bars ending at each index
Inputs
inHigh— High price of each barinLow— Low price of each bar
Outputs
outReal— Midpoint of the period's high/low extremes
Parameters
| Parameter | Type | Default | Accepted values | Description |
|---|---|---|---|---|
optInTimePeriod | integer | 14 | 2–100000 | Window length over which the high/low extremes are taken |
Properties
Numerical Stability: Start-Independent
| Display Flags |
|---|
| ✅ Overlap Input i |
| ☐ Independent Y-Axis |
| ☐ Candlestick |
Implementation
TA-Lib Definition: midprice.c · midprice.yaml
| Native | File |
|---|---|
| C | ta_MIDPRICE.c |
| Rust | midprice.rs |
| Java | Core_MIDPRICE.java |
TA-Lib is also available for Python, R and more using a wrapper.
Aliases
Midpoint Price