Copyright | 2016 Tebello Thejane |
---|---|
License | BSD3 |
Maintainer | Tebello Thejane <zyxoas+hackage@gmail.com> |
Stability | Experimental |
Portability | non-portable (GHC Extensions) |
Safe Haskell | None |
Language | Haskell2010 |
Creating and working with orders
Trading on the market is done by submitting trade orders. After a new order has been created, it is submitted for processing by the order matching engine. The order then either matches against an existing order in the order book and is filled or it rests in the order book until it is stopped.
- getAllOrders :: BitXAuth -> Maybe CcyPair -> Maybe RequestStatus -> IO (BitXAPIResponse [PrivateOrder])
- postOrder :: BitXAuth -> OrderRequest -> IO (BitXAPIResponse OrderID)
- stopOrder :: BitXAuth -> OrderID -> IO (BitXAPIResponse RequestSuccess)
- getOrder :: BitXAuth -> OrderID -> IO (BitXAPIResponse PrivateOrder)
- postMarketOrder :: BitXAuth -> MarketOrderRequest -> IO (BitXAPIResponse OrderID)
- getAllTrades :: BitXAuth -> CcyPair -> Maybe UTCTime -> Maybe Integer -> IO (BitXAPIResponse [PrivateTrade])
Documentation
getAllOrders :: BitXAuth -> Maybe CcyPair -> Maybe RequestStatus -> IO (BitXAPIResponse [PrivateOrder]) Source #
Returns a list of the most recently placed orders.
If the second parameter is Nothing
then this will return orders for all markets, whereas if it is
Just cpy
for some CcyPair cpy
then the results will be specific to that market.
If the third parameter is Nothing
then this will return orders in all states, whereas if it is
Just COMPLETE
or Just PENDING
then it will return only completed or pending orders, respectively.
This list is truncated after 100 items.
Perm_R_Orders
permission is required.
postOrder :: BitXAuth -> OrderRequest -> IO (BitXAPIResponse OrderID) Source #
Create a new order.
Warning! Orders cannot be reversed once they have executed. Please ensure your program has been thoroughly tested before submitting orders.
Perm_W_Orders
permission is required.
stopOrder :: BitXAuth -> OrderID -> IO (BitXAPIResponse RequestSuccess) Source #
Request to stop an order.
Perm_W_Orders
permission is required.
getOrder :: BitXAuth -> OrderID -> IO (BitXAPIResponse PrivateOrder) Source #
Get an order by its ID
Perm_R_Orders
permission is required.
postMarketOrder :: BitXAuth -> MarketOrderRequest -> IO (BitXAPIResponse OrderID) Source #
Create a new market order.
Warning! Orders cannot be reversed once they have executed. Please ensure your program has been thoroughly tested before submitting orders.
A market order executes immediately, and either buys as much bitcoin that can be bought for a set amount of fiat currency, or sells a set amount of bitcoin for as much fiat as possible.
Use order type BID
to buy bitcoin or ASK
to sell.
Perm_W_Orders
permission is required.
getAllTrades :: BitXAuth -> CcyPair -> Maybe UTCTime -> Maybe Integer -> IO (BitXAPIResponse [PrivateTrade]) Source #
Returns a list of your recent trades for a given pair, sorted by oldest first.
Perm_R_Orders
permission is required.