BTCMarkets / API

API
119 stars 30 forks source link

How to get direction and type for trades? #134

Closed StefanSchmidtOz closed 6 years ago

StefanSchmidtOz commented 6 years ago

I would like to retrieve the direction (buy/sell) and the type of trade (market, limit) for trades, not only my own trades but trades executed by others. There is this endpoint /market/BTC/AUD/trades, which returns tid, amount, price and date, ideally it should include the direction and type.

On the homepage there is a table for the last 50 trades, which includes the direction buy/sell of the trade. But there seems to be no way to get that information via the provided API.

justin-ngin commented 6 years ago

Hi @StefanSchmidtOz ,

Could you please elaborate? Trades on public market data API don't have a direction, as they are the fulfillment of a buy order and a sell order. Similarly, they don't have a type, as either the "buyer" or "seller" could have placed market or limit buy/sell orders.

On the homepage of the website, there is a table for the last 50 trades, but it doesn't have a side column for the trade. The orderbook tables show the 50 closest (to matching) buy and sell orders each. This data is also available through the orderbook endpoint of the market data API.

Regards, Justin

StefanSchmidtOz commented 6 years ago

Thank you @justin-ngin for the quick response!

That now makes perfect sense to me, trade being a match of a sell and buy order.

Misunderstanding on my side, due to looking at another exchange API which provides price, volume, time, buy/sell, market/limit on their trade endpoint.