Summary
Functions
Get candlestick data for an instrument.
Get candlestick data for an instrument, raising an exception on error.
Functions
@spec list_candles(ExOanda.Connection.t(), String.t(), Keyword.t()) :: {:ok, ExOanda.Response.t(ExOanda.Response.ListCandles.t())} | {:error, ExOanda.Response.t() | ExOanda.ValidationError.t() | ExOanda.TransportError.t() | ExOanda.DecodeError.t()}
Get candlestick data for an instrument.
Examples
iex> {:ok, res} = ExOanda.Instruments.list_candles(conn, instrument)Supported parameters
:weekly_alignment(String.t/0) - The day of the week used for granularities that have weekly alignment. The default value is"Friday".:alignment_timezone(String.t/0) - The timezone to use for the dailyAlignment parameter, note that the returned times will still be represented in UTC. The default value is"America/New_York".:daily_alignment(non_neg_integer/0) - The hour of the day (in the specified timezone) to use for granularities that have daily alignments, minimum 0, maximum 23.:include_first(boolean/0) - A flag that controls whether the candlestick that is covered by the from time should be included in the results.:smooth(boolean/0) - A flag that controls whether the candlestick is smoothed or not.:to(String.t/0) - The end of the time range to fetch candlesticks for using either RFC 3339 or Unix format.:from(String.t/0) - The start of the time range to fetch candlesticks for using either RFC 3339 or Unix format.:count(non_neg_integer/0) - The number of candles to return, maximum 5000.:granularity(String.t/0) - The granularity of the candlesticks to fetch. The default value is"S5".:price(String.t/0) - The Price component(s) to get candlestick data for. The default value is"M".
Docs
@spec list_candles!(ExOanda.Connection.t(), String.t(), Keyword.t()) :: ExOanda.Response.t(ExOanda.Response.ListCandles.t())
Get candlestick data for an instrument, raising an exception on error.
Examples
iex> res = ExOanda.Instruments.list_candles!(conn, instrument)Supported parameters
:weekly_alignment(String.t/0) - The day of the week used for granularities that have weekly alignment. The default value is"Friday".:alignment_timezone(String.t/0) - The timezone to use for the dailyAlignment parameter, note that the returned times will still be represented in UTC. The default value is"America/New_York".:daily_alignment(non_neg_integer/0) - The hour of the day (in the specified timezone) to use for granularities that have daily alignments, minimum 0, maximum 23.:include_first(boolean/0) - A flag that controls whether the candlestick that is covered by the from time should be included in the results.:smooth(boolean/0) - A flag that controls whether the candlestick is smoothed or not.:to(String.t/0) - The end of the time range to fetch candlesticks for using either RFC 3339 or Unix format.:from(String.t/0) - The start of the time range to fetch candlesticks for using either RFC 3339 or Unix format.:count(non_neg_integer/0) - The number of candles to return, maximum 5000.:granularity(String.t/0) - The granularity of the candlesticks to fetch. The default value is"S5".:price(String.t/0) - The Price component(s) to get candlestick data for. The default value is"M".