View Source ExTwelveData.RealTimePrices (ExTwelveData v0.2.1)

WebSocket client to get real-time prices from Twelve Data.

Link to this section Summary

Functions

Reset the subscription to all price updates.

Specify a list of symbols you're interested to.

Send a list of symbols that you're no longer interested to.

Link to this section Types

@type option() ::
  WebSockex.option()
  | {:api_key, binary()}
  | {:handler, ExTwelveData.RealTimePrices.Handler}
@type options() :: [option()]

Link to this section Functions

@spec reset(pid()) :: {:error, any()} | {:ok}

Reset the subscription to all price updates.

@spec start_link(options()) :: {:error, any()} | {:ok, pid()}
Link to this function

subscribe(client, symbols)

View Source
@spec subscribe(pid(), [String.t()]) :: {:error, any()} | {:ok}

Specify a list of symbols you're interested to.

Subsequent calls will append new symbols to the list. See unsubscribe/2 and reset/1 to remove

Link to this function

unsubscribe(client, symbols)

View Source
@spec unsubscribe(pid(), [String.t()]) :: {:error, any()} | {:ok}

Send a list of symbols that you're no longer interested to.

Twelve Data will stop sending updates.