tai v0.0.9 Tai.Exchanges.Account behaviour
Uniform interface for private exchange actions
Link to this section Summary
Functions
Fetches all balances on the exchange for the account
Create a buy limit order from the given order struct. It returns an error tuple when the type is not accepted
Create a buy limit order on the exchange with the given
Cancels the order on the exchange and returns the order_id
Fetches the status of the order from the exchange
Create a sell limit order from the given order struct. It returns an error tuple when the type is not accepted
Create a sell limit order on the exchange with the given
Returns an atom which identifies the process for the given account_id
Link to this section Types
insufficient_balance_error() :: Tai.Trading.InsufficientBalanceError.t()
invalid_order_type_error() :: Tai.Trading.OrderResponses.InvalidOrderType.t()
Link to this section Functions
all_balances(atom(), atom()) :: {:ok, map()} | {:error, credential_error() | timeout_error()}
Fetches all balances on the exchange for the account
buy_limit(order()) :: {:ok, order_response()} | {:error, invalid_order_type_error() | insufficient_balance_error()}
Create a buy limit order from the given order struct. It returns an error tuple when the type is not accepted.
{:error, %Tai.Trading.OrderResponses.InvalidOrderType{}}
buy_limit(atom(), atom(), atom(), number(), number(), atom()) :: {:ok, order_response()} | {:error, insufficient_balance_error()}
Create a buy limit order on the exchange with the given
- symbol
- price
- size
- time_in_force
Cancels the order on the exchange and returns the order_id
Fetches the status of the order from the exchange
Create a sell limit order from the given order struct. It returns an error tuple when the type is not accepted.
{:error, %Tai.Trading.OrderResponses.InvalidOrderType{}}
Create a sell limit order on the exchange with the given
- symbol
- price
- size
- time_in_force
Returns an atom which identifies the process for the given account_id
Examples
iex> Tai.Exchanges.Account.to_name(:my_test_exchange, :my_test_account) :”Elixir.Tai.Exchanges.Account_my_test_exchange_my_test_account”