Summary
Functions
Close (partially or fully) a specific open Trade in an Account.
Close (partially or fully) a specific open Trade in an Account, raising an exception on error.
Get details for a single trade in an account.
Get details for a single trade in an account, raising an exception on error.
Get a list of trades for an account.
Get a list of trades for an account, raising an exception on error.
Get a list of open trades for an account.
Get a list of open trades for an account, raising an exception on error.
Update the Client Extensions for a Trade. Do not set, modify, or delete clientExtensions if your account is associated with MT4.
Update the Client Extensions for a Trade. Do not set, modify, or delete clientExtensions if your account is associated with MT4, raising an exception on error.
Create, replace and cancel a Trade's dependent Orders (Take Profit, Stop Loss and Trailing Stop Loss) through the Trade itself.
Create, replace and cancel a Trade's dependent Orders (Take Profit, Stop Loss and Trailing Stop Loss) through the Trade itself, raising an exception on error.
Functions
@spec close(ExOanda.Connection.t(), String.t(), String.t(), map(), Keyword.t()) :: {:ok, ExOanda.Response.t(ExOanda.Response.CloseTrade.t())} | {:error, ExOanda.Response.t() | ExOanda.ValidationError.t() | ExOanda.TransportError.t() | ExOanda.DecodeError.t()}
Close (partially or fully) a specific open Trade in an Account.
Examples
iex> {:ok, res} = ExOanda.Trades.close(conn, account_id, trade_id, body)Docs
@spec close!(ExOanda.Connection.t(), String.t(), String.t(), map(), Keyword.t()) :: ExOanda.Response.t(ExOanda.Response.CloseTrade.t())
Close (partially or fully) a specific open Trade in an Account, raising an exception on error.
Examples
iex> res = ExOanda.Trades.close!(conn, account_id, trade_id, body)Docs
@spec find(ExOanda.Connection.t(), String.t(), String.t(), Keyword.t()) :: {:ok, ExOanda.Response.t(ExOanda.Response.FindTrade.t())} | {:error, ExOanda.Response.t() | ExOanda.ValidationError.t() | ExOanda.TransportError.t() | ExOanda.DecodeError.t()}
Get details for a single trade in an account.
Examples
iex> {:ok, res} = ExOanda.Trades.find(conn, account_id, trade_id)Docs
@spec find!(ExOanda.Connection.t(), String.t(), String.t(), Keyword.t()) :: ExOanda.Response.t(ExOanda.Response.FindTrade.t())
Get details for a single trade in an account, raising an exception on error.
Examples
iex> res = ExOanda.Trades.find!(conn, account_id, trade_id)Docs
@spec list(ExOanda.Connection.t(), String.t(), Keyword.t()) :: {:ok, ExOanda.Response.t(ExOanda.Response.ListTrades.t())} | {:error, ExOanda.Response.t() | ExOanda.ValidationError.t() | ExOanda.TransportError.t() | ExOanda.DecodeError.t()}
Get a list of trades for an account.
Examples
iex> {:ok, res} = ExOanda.Trades.list(conn, account_id)Supported parameters
:before_id(String.t/0) - The maximum Trade ID to return. If not provided the most recent Trades in the Account are returned.:count(non_neg_integer/0) - The maximum number of Trades to return.:instrument(String.t/0) - The instrument to filter the requested trades by.:state(String.t/0) - The state to filter the requested Trades by.:ids(String.t/0) - List of Trade IDs to retrieve.
Docs
@spec list!(ExOanda.Connection.t(), String.t(), Keyword.t()) :: ExOanda.Response.t(ExOanda.Response.ListTrades.t())
Get a list of trades for an account, raising an exception on error.
Examples
iex> res = ExOanda.Trades.list!(conn, account_id)Supported parameters
:before_id(String.t/0) - The maximum Trade ID to return. If not provided the most recent Trades in the Account are returned.:count(non_neg_integer/0) - The maximum number of Trades to return.:instrument(String.t/0) - The instrument to filter the requested trades by.:state(String.t/0) - The state to filter the requested Trades by.:ids(String.t/0) - List of Trade IDs to retrieve.
Docs
@spec list_open(ExOanda.Connection.t(), String.t(), Keyword.t()) :: {:ok, ExOanda.Response.t(ExOanda.Response.ListTrades.t())} | {:error, ExOanda.Response.t() | ExOanda.ValidationError.t() | ExOanda.TransportError.t() | ExOanda.DecodeError.t()}
Get a list of open trades for an account.
Examples
iex> {:ok, res} = ExOanda.Trades.list_open(conn, account_id)Docs
@spec list_open!(ExOanda.Connection.t(), String.t(), Keyword.t()) :: ExOanda.Response.t(ExOanda.Response.ListTrades.t())
Get a list of open trades for an account, raising an exception on error.
Examples
iex> res = ExOanda.Trades.list_open!(conn, account_id)Docs
@spec modify_client_extensions( ExOanda.Connection.t(), String.t(), String.t(), map(), Keyword.t() ) :: {:ok, ExOanda.Response.t(ExOanda.Response.TradeModifyClientExtensions.t())} | {:error, ExOanda.Response.t() | ExOanda.ValidationError.t() | ExOanda.TransportError.t() | ExOanda.DecodeError.t()}
Update the Client Extensions for a Trade. Do not set, modify, or delete clientExtensions if your account is associated with MT4.
Examples
iex> {:ok, res} = ExOanda.Trades.modify_client_extensions(conn, account_id, trade_id, body)Docs
@spec modify_client_extensions!( ExOanda.Connection.t(), String.t(), String.t(), map(), Keyword.t() ) :: ExOanda.Response.t(ExOanda.Response.TradeModifyClientExtensions.t())
Update the Client Extensions for a Trade. Do not set, modify, or delete clientExtensions if your account is associated with MT4, raising an exception on error.
Examples
iex> res = ExOanda.Trades.modify_client_extensions!(conn, account_id, trade_id, body)Docs
@spec update(ExOanda.Connection.t(), String.t(), String.t(), map(), Keyword.t()) :: {:ok, ExOanda.Response.t(ExOanda.Response.UpdateTrade.t())} | {:error, ExOanda.Response.t() | ExOanda.ValidationError.t() | ExOanda.TransportError.t() | ExOanda.DecodeError.t()}
Create, replace and cancel a Trade's dependent Orders (Take Profit, Stop Loss and Trailing Stop Loss) through the Trade itself.
Examples
iex> {:ok, res} = ExOanda.Trades.update(conn, account_id, trade_id, body)Docs
@spec update!(ExOanda.Connection.t(), String.t(), String.t(), map(), Keyword.t()) :: ExOanda.Response.t(ExOanda.Response.UpdateTrade.t())
Create, replace and cancel a Trade's dependent Orders (Take Profit, Stop Loss and Trailing Stop Loss) through the Trade itself, raising an exception on error.
Examples
iex> res = ExOanda.Trades.update!(conn, account_id, trade_id, body)