# Documentation

### This is machine translation

Translated by
Mouseover text to see original. Click the button below to return to the English verison of the page.

# medprice

## 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 name`LowName` — low prices series name `ParameterValue` Parameter values are the character vectors 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 character vectors that represent the valid parameter names.

## Examples

collapse all

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 Edition. McGraw-Hill, 1995, pp. 177–178.