ExOanda.Trades (ExOanda v0.2.3)

Copy Markdown View Source

Interface for Oanda trades.

Docs

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

close(conn, account_id, trade_id, body, params \\ [])

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

close!(conn, account_id, trade_id, body, params \\ [])

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

find(conn, account_id, trade_id, params \\ [])

Get details for a single trade in an account.

Examples

iex> {:ok, res} = ExOanda.Trades.find(conn, account_id, trade_id)

Docs

find!(conn, account_id, trade_id, params \\ [])

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

list(conn, account_id, params \\ [])

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

list!(conn, account_id, params \\ [])

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

list_open(conn, account_id, params \\ [])

Get a list of open trades for an account.

Examples

iex> {:ok, res} = ExOanda.Trades.list_open(conn, account_id)

Docs

list_open!(conn, account_id, params \\ [])

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

modify_client_extensions(conn, account_id, trade_id, body, params \\ [])

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

modify_client_extensions!(conn, account_id, trade_id, body, params \\ [])

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

update(conn, account_id, trade_id, body, params \\ [])

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

update!(conn, account_id, trade_id, body, params \\ [])

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)

Docs