TAlib.Indicators.PriceTransform (TAlib v0.13.0)

Copy Markdown View Source

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.

Summary

Functions

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

The Average Price of every bar.

Median Price: (high + low) / 2.

The Median Price of every bar.

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

The Typical Price of every bar.

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

The Weighted Close Price of every bar.

Functions

avgprice(map)

@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(bars)

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

The Average Price of every bar.

medprice(map)

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

Median Price: (high + low) / 2.

Examples

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

medprice_list(bars)

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

The Median Price of every bar.

typprice(map)

@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(bars)

@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(map)

@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(bars)

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

The Weighted Close Price of every bar.