Tradehub.Ticker (Tradehub v0.1.7) View Source

Enable features to work with tickers endpoints.

Link to this section Summary

Functions

Requests candlesticks for the given market.

Requests latest statistics information about the given market or all markets

Requests prices of the given market.

Link to this section Functions

Link to this function

candlesticks(market, resolution, from, to)

View Source

Specs

candlesticks(String.t(), integer(), integer(), integer()) ::
  {:ok, [Tradehub.candlestick()]} | {:error, HTTPoison.Error.t()}

Requests candlesticks for the given market.

Parameters

  • market: the market symbols: e.g swth_eth1
  • resolution: the candlestick period in minutes, possible values are: 1, 5, 30, 60, 360, 1440
  • from: the start of time range for data in epoch seconds
  • to: the end of time range for data in epoch seconds

Examples

iex> Tradehub.Ticker.candlesticks("swth_eth1", 5, 1610203000, 1610203000)
Link to this function

market_stats(market \\ nil)

View Source

Specs

market_stats(nil) ::
  {:ok, [Tradehub.market_stats()]} | {:error, HTTPoison.Error.t()}
market_stats(String.t()) ::
  {:ok, [Tradehub.market_stats()]} | {:error, HTTPoison.Error.t()}

Requests latest statistics information about the given market or all markets

Examples

iex> Tradehub.Ticker.market_stats
iex> Tradehub.Ticker.market_stats("swth_eth1")

Specs

prices(String.t()) ::
  {:ok, Tradehub.ticker_prices()} | {:error, HTTPoison.Error.t()}

Requests prices of the given market.

Examples

iex> Tradehub.Ticker.prices("swth_eth1")