Bourse.WS.Semantics.Ohlcv (bourse v0.1.0)

Copy Markdown View Source

OHLCV cache driven by websocket.ohlcv_semantics.

Summary

Functions

Applies a routed OHLCV payload and returns updated state + candle.

Builds state from exchange spec semantics.

Types

t()

@type t() :: %Bourse.WS.Semantics.Ohlcv{
  cache_type: String.t() | nil,
  caches: %{required(String.t()) => map() | nil},
  closed_signal: String.t() | nil,
  timeframe_key: String.t() | nil,
  update_model: String.t()
}

Functions

apply(state, key, payload)

@spec apply(t(), String.t(), term()) :: {t(), map() | nil}

Applies a routed OHLCV payload and returns updated state + candle.

new(exchange)

@spec new(Bourse.Exchange.t()) :: t()

Builds state from exchange spec semantics.