ExOanda.Orders (ExOanda v0.2.3)

Copy Markdown View Source

Interface for Oanda orders.

Docs

Summary

Functions

Cancel a pending order in an account.

Cancel a pending order in an account, raising an exception on error.

Create an order for an account.

Create an order for an account, raising an exception on error.

Get details for a single order in an account.

Get details for a single order in an account, raising an exception on error.

Get a list of orders for an account.

Get a list of orders for an account, raising an exception on error.

Get a list of pending orders for an account.

Get a list of pending orders for an account, raising an exception on error.

Update the Client Extensions for an Order in an Account. Do not set, modify, or delete clientExtensions if your account is associated with MT4.

Update the Client Extensions for an Order in an Account. Do not set, modify, or delete clientExtensions if your account is associated with MT4, raising an exception on error.

Replace an order in an account by simultaneously cancelling it and creating a replacement order.

Replace an order in an account by simultaneously cancelling it and creating a replacement order, raising an exception on error.

Functions

cancel(conn, account_id, order_id, params \\ [])

Cancel a pending order in an account.

Examples

iex> {:ok, res} = ExOanda.Orders.cancel(conn, account_id, order_id)

Docs

cancel!(conn, account_id, order_id, params \\ [])

Cancel a pending order in an account, raising an exception on error.

Examples

iex> res = ExOanda.Orders.cancel!(conn, account_id, order_id)

Docs

create(conn, account_id, body, params \\ [])

Create an order for an account.

Examples

iex> {:ok, res} = ExOanda.Orders.create(conn, account_id, body)

Docs

create!(conn, account_id, body, params \\ [])

Create an order for an account, raising an exception on error.

Examples

iex> res = ExOanda.Orders.create!(conn, account_id, body)

Docs

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

Get details for a single order in an account.

Examples

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

Docs

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

Get details for a single order in an account, raising an exception on error.

Examples

iex> res = ExOanda.Orders.find!(conn, account_id, order_id)

Docs

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

Get a list of orders for an account.

Examples

iex> {:ok, res} = ExOanda.Orders.list(conn, account_id)

Supported parameters

  • :before_id (String.t/0) - The maximum Order ID to return. If not provided the most recent Orders in the Account are returned.

  • :count (non_neg_integer/0) - The maximum number of Orders to return.

  • :instrument (String.t/0) - The instrument to filter the requested orders by.

  • :state (String.t/0) - The state to filter the requested Orders by.

  • :ids (String.t/0) - List of Order IDs to retrieve.

Docs

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

Get a list of orders for an account, raising an exception on error.

Examples

iex> res = ExOanda.Orders.list!(conn, account_id)

Supported parameters

  • :before_id (String.t/0) - The maximum Order ID to return. If not provided the most recent Orders in the Account are returned.

  • :count (non_neg_integer/0) - The maximum number of Orders to return.

  • :instrument (String.t/0) - The instrument to filter the requested orders by.

  • :state (String.t/0) - The state to filter the requested Orders by.

  • :ids (String.t/0) - List of Order IDs to retrieve.

Docs

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

Get a list of pending orders for an account.

Examples

iex> {:ok, res} = ExOanda.Orders.list_pending(conn, account_id)

Docs

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

Get a list of pending orders for an account, raising an exception on error.

Examples

iex> res = ExOanda.Orders.list_pending!(conn, account_id)

Docs

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

Update the Client Extensions for an Order in an Account. Do not set, modify, or delete clientExtensions if your account is associated with MT4.

Examples

iex> {:ok, res} = ExOanda.Orders.modify_client_extensions(conn, account_id, order_id, body)

Docs

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

Update the Client Extensions for an Order in an Account. Do not set, modify, or delete clientExtensions if your account is associated with MT4, raising an exception on error.

Examples

iex> res = ExOanda.Orders.modify_client_extensions!(conn, account_id, order_id, body)

Docs

replace(conn, account_id, order_id, body, params \\ [])

Replace an order in an account by simultaneously cancelling it and creating a replacement order.

Examples

iex> {:ok, res} = ExOanda.Orders.replace(conn, account_id, order_id, body)

Docs

replace!(conn, account_id, order_id, body, params \\ [])

Replace an order in an account by simultaneously cancelling it and creating a replacement order, raising an exception on error.

Examples

iex> res = ExOanda.Orders.replace!(conn, account_id, order_id, body)

Docs