Accelerating the pace of engineering and science

# medprice

Median price

## Syntax

```mprc = medprice(highp, lowp)
mprc = medprice([highp lowp])
mprcts = medprice(tsobj)
mprcts = medprice(tsobj, ParameterName, ParameterValue, ...)
```

## Arguments

 highp High price (vector) lowp Low price (vector) tsobj Financial time series object ParameterName Valid parameter names are:HighName: high prices series nameLowName: low prices series name ParameterValue Parameter values are the strings that represent the valid parameter names.

## Description

mprc = medprice(highp, lowp) calculates the median prices mprc from the high (highp) and low (lowp) prices. The median price is the average of the high and low price for each period.

mprc = medprice([highp lowp]) accepts a two-column matrix as the input rather than two individual vectors. The columns of the matrix represent the high and low prices, in that order.

mprcts = medprice(tsobj) calculates the median prices of a financial time series object tsobj. The object must minimally contain the series High and Low. The median price is the average of the high and low price each period. mprcts is a financial time series object with the same dates as tsobj and the data series MedPrice.

mprcts = medprice(tsobj, ParameterName, ParameterValue, ...) accepts parameter name/parameter value pairs as input. These pairs specify the name(s) for the required data series if it is different from the expected default name(s). Parameter values are the strings that represent the valid parameter names.

## Examples

expand all

### Compute the Median Price

This example shows how to compute the median price for Disney stock and plot the results.

```load disney.mat
dis_MedPrice = medprice(dis);
plot(dis_MedPrice)
title('Median Price for Disney')
```

## References

Achelis, Steven B., Technical Analysis from A to Z, Second printing, McGraw-Hill, 1995, pp. 177 -178.