ExOkex.Swap.Private (ExOkex v0.6.0) View Source
Swap account client.
Link to this section Summary
Functions
Amend multiple open orders for a specific trading pair (up to 10 orders)
Cancelling an unfilled order.
Place multiple orders for specific trading pairs (up to 4 trading pairs, maximum 4 orders each)
Place a new order.
Get the swap account info of all token.
Retrieve the information on all your positions in the swap account.
Retrieve information on your positions of a single contract.
Link to this section Types
Specs
config() :: ExOkex.Config.t()
Specs
instrument_id() :: String.t()
Specs
params() :: map()
Specs
response() :: ExOkex.Api.response()
Link to this section Functions
Specs
amend_bulk_orders(instrument_id(), params(), config() | nil) :: response()
Amend multiple open orders for a specific trading pair (up to 10 orders)
https://www.okex.com/docs/en/#swap-swap---amend_batch
Examples
iex> ExOkex.Futures.Private.amend_bulk_orders("BTC-USD-180213", [ %{amend_data: [
%{order_id: "305512815291895607",new_size: "2"},
%{order_id: "305512815291895606",new_size: "1"}
]})
cancel_orders(instrument_id, order_ids \\ [], params \\ %{}, config \\ nil)
View SourceCancelling an unfilled order.
https://www.okex.com/docs/en/#swap-swap---revocation
Example
iex> ExOkex.Swap.cancel_orders("BTC-USD-180309", [1600593327162368,1600593327162369])
See ExOkex.Swap.Private.CreateBulkOrders.create_bulk_orders/2
.
Specs
Place multiple orders for specific trading pairs (up to 4 trading pairs, maximum 4 orders each)
https://www.okex.com/docs/en/#swap-swap---batch
Examples
iex> ExOkex.Swap.create_bulk_orders([ %{"instrument_id":"BTC-USD-180213",
"type":"1",
"price":"432.11",
"size":"2",
"match_price":"0",
"leverage":"10" },
])
Specs
Place a new order.
Examples
iex> ExOkex.Swap.create_order(%{ instrument_id: "BTC-USD-180213", leverage: "10", orders_data: [%{
type: "1",
price: "432.11",
size: "2",
match_price: "0"
}] }) {:ok, %{"order_info" => [%{"error_code" => 0, "error_message" => "", "order_id" => "2653481276189696"}], "result" => true}}
Get the swap account info of all token.
https://www.okex.com/docs/en/#swap-singleness
Examples
iex(3)> ExOkex.Swap.list_accounts()
Retrieve the information on all your positions in the swap account.
https://www.okex.com/docs/en/#swap-swap---hold_information
Examples
iex(3)> ExOkex.Swap.list_positions()
Retrieve information on your positions of a single contract.
https://www.okex.com/docs/en/#swap-swap---only
Examples
iex(3)> ExOkex.Swap.position("BTC-USD-190329")