ExOanda.Positions (ExOanda v0.1.1)
View SourceInterface for Oanda positions.
Docs
Summary
Functions
Closeout the open Position for a specific instrument in an Account.
Closeout the open Position for a specific instrument in an Account, raising an exception on error.
Get the details of a single instrument's position in an account.
Get the details of a single instrument's position in an account, raising an exception on error.
Get a list of positions for an account.
Get a list of positions for an account, raising an exception on error.
Get a list of open positions for an account.
Get a list of open positions for an account, raising an exception on error.
Functions
@spec close(ExOanda.Connection.t(), String.t(), String.t(), map(), Keyword.t()) :: {:ok, ExOanda.Response.t(ExOanda.Response.ClosePosition.t())} | {:error, ExOanda.Response.t() | ExOanda.ValidationError.t() | ExOanda.TransportError.t() | ExOanda.DecodeError.t()}
Closeout the open Position for a specific instrument in an Account.
Examples
iex> {:ok, res} = ExOanda.Positions.close(conn, account_id, instrument, body)Docs
@spec close!(ExOanda.Connection.t(), String.t(), String.t(), map(), Keyword.t()) :: ExOanda.Response.t(ExOanda.Response.ClosePosition.t())
Closeout the open Position for a specific instrument in an Account, raising an exception on error.
Examples
iex> res = ExOanda.Positions.close!(conn, account_id, instrument, body)Docs
@spec find(ExOanda.Connection.t(), String.t(), String.t(), Keyword.t()) :: {:ok, ExOanda.Response.t(ExOanda.Response.ListPositions.t())} | {:error, ExOanda.Response.t() | ExOanda.ValidationError.t() | ExOanda.TransportError.t() | ExOanda.DecodeError.t()}
Get the details of a single instrument's position in an account.
Examples
iex> {:ok, res} = ExOanda.Positions.find(conn, account_id, instrument)Docs
@spec find!(ExOanda.Connection.t(), String.t(), String.t(), Keyword.t()) :: ExOanda.Response.t(ExOanda.Response.ListPositions.t())
Get the details of a single instrument's position in an account, raising an exception on error.
Examples
iex> res = ExOanda.Positions.find!(conn, account_id, instrument)Docs
@spec list(ExOanda.Connection.t(), String.t(), Keyword.t()) :: {:ok, ExOanda.Response.t(ExOanda.Response.ListPositions.t())} | {:error, ExOanda.Response.t() | ExOanda.ValidationError.t() | ExOanda.TransportError.t() | ExOanda.DecodeError.t()}
Get a list of positions for an account.
Examples
iex> {:ok, res} = ExOanda.Positions.list(conn, account_id)Docs
@spec list!(ExOanda.Connection.t(), String.t(), Keyword.t()) :: ExOanda.Response.t(ExOanda.Response.ListPositions.t())
Get a list of positions for an account, raising an exception on error.
Examples
iex> res = ExOanda.Positions.list!(conn, account_id)Docs
@spec list_open(ExOanda.Connection.t(), String.t(), Keyword.t()) :: {:ok, ExOanda.Response.t(ExOanda.Response.ListPositions.t())} | {:error, ExOanda.Response.t() | ExOanda.ValidationError.t() | ExOanda.TransportError.t() | ExOanda.DecodeError.t()}
Get a list of open positions for an account.
Examples
iex> {:ok, res} = ExOanda.Positions.list_open(conn, account_id)Docs
@spec list_open!(ExOanda.Connection.t(), String.t(), Keyword.t()) :: ExOanda.Response.t(ExOanda.Response.ListPositions.t())
Get a list of open positions for an account, raising an exception on error.
Examples
iex> res = ExOanda.Positions.list_open!(conn, account_id)