TAlib.Indicators.BOP (TAlib v0.13.0)

Copy Markdown View Source

Balance of Power: (close - open) / (high - low).

Ranges from -1 (close at the low after opening at the high) to 1. Bars are maps with :open, :high, :low and :close; zero-range bars give nil. See TAlib for the conventions.

Summary

Functions

The Balance of Power of the latest bar.

The Balance of Power of every bar.

Functions

bop(bars)

@spec bop([map()]) :: float() | nil

The Balance of Power of the latest bar.

Examples

iex> bars = [
...>   %{open: 9.5, high: 10, low: 9, close: 9.5},
...>   %{open: 10.0, high: 11, low: 9.5, close: 10.5}
...> ]
iex> TAlib.Indicators.BOP.bop(bars) |> Float.round(4)
0.3333

bop_list(bars)

@spec bop_list([map()]) :: [float() | nil]

The Balance of Power of every bar.

iex> TAlib.Indicators.BOP.bop_list([
...>   %{open: 9.5, high: 10, low: 9, close: 9.5},
...>   %{open: 10.0, high: 11, low: 9.5, close: 10.5}
...> ])
[0.0, 0.3333333333333333]