# `TAlib.Indicators.PriceTransform`
[🔗](https://github.com/benyblack/talib/blob/main/lib/indicators/price_transform.ex#L1)

Price Transform functions (TA-Lib group).

Bars are maps with at least `:high`, `:low` and `:close` (`:open` for
`avgprice/1`); extra keys are ignored. Transforms are per-bar and
defined for every bar. See `TAlib` for the conventions.

# `avgprice`

```elixir
@spec avgprice(map()) :: float()
```

Average Price: `(open + high + low + close) / 4`.

## Examples

    iex> TAlib.Indicators.PriceTransform.avgprice(%{open: 10, high: 12, low: 8, close: 11})
    10.25

# `avgprice_list`

```elixir
@spec avgprice_list([map()]) :: [float()]
```

The Average Price of every bar.

# `medprice`

```elixir
@spec medprice(map()) :: float()
```

Median Price: `(high + low) / 2`.

## Examples

    iex> TAlib.Indicators.PriceTransform.medprice(%{high: 12, low: 8})
    10.0

# `medprice_list`

```elixir
@spec medprice_list([map()]) :: [float()]
```

The Median Price of every bar.

# `typprice`

```elixir
@spec typprice(map()) :: float()
```

Typical Price: `(high + low + close) / 3`.

## Examples

    iex> TAlib.Indicators.PriceTransform.typprice(%{high: 12, low: 8, close: 11})
    10.333333333333334

# `typprice_list`

```elixir
@spec typprice_list([map()]) :: [float()]
```

The Typical Price of every bar.

    iex> TAlib.Indicators.PriceTransform.typprice_list([
    ...>   %{high: 12, low: 8, close: 10},
    ...>   %{high: 13, low: 9, close: 12}
    ...> ])
    [10.0, 11.333333333333334]

# `wclprice`

```elixir
@spec wclprice(map()) :: float()
```

Weighted Close Price: `(high + low + 2 * close) / 4`.

## Examples

    iex> TAlib.Indicators.PriceTransform.wclprice(%{high: 12, low: 8, close: 11})
    10.5

# `wclprice_list`

```elixir
@spec wclprice_list([map()]) :: [float()]
```

The Weighted Close Price of every bar.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
