<p>Indeed they don't specify what it means, but the only sane option is that market/limit tag comes from the type of order that closed the deal.</p>

<p>For example there are two lowest sell(ask) orders hanging in the order book:</p>

<ul>
<li><p>0.05 BTC at 2000 EUR</p></li>
<li><p>0.03 BTC at 2300 EUR</p></li>
</ul>

<p>I come to Kraken and place a Market order, buy(bid) for 0.07 BTC, thus the first trade will be for 0.05 BTC, and the second will be for 0.02 BTC. Both will have designation 'market'.</p>

<p>It is possible, however that I want to buy some bitcoin, (let's say 0.9 BTC), but not higher than 2300 EUR. Then to make sure I don't pay more than planned, I make a LIMIT order and the two awaiting orders are matched to mine and what is left of my order amount may hang in the order book on the Buy side. In this scenario the trades as seen via API will have designation 'limit'</p>

CC BY-SA 3.0
2017-11-01T20:49:20.800Z
2017-11-01T20:49:20.800Z
Ilia Gilmijarow
<p>I want to build historical OHLC data from the Kraken trades. Since Kraken does not provide historical OHLC data (at least not going far back), they recommend one builds it oneself using the list of trades (<a href="https://support.kraken.com/hc/en-us/articles/218198197-How-to-pull-all-trade-data-using-the-Kraken-REST-API" rel="noreferrer">https://support.kraken.com/hc/en-us/articles/218198197-How-to-pull-all-trade-data-using-the-Kraken-REST-API</a>). Their trades API does indeed return trades as far back as October 2013, but I do not understand how to interpret the data.</p>

<p>They return the following information for each trade (see <a href="https://www.kraken.com/help/api#get-recent-trades" rel="noreferrer">https://www.kraken.com/help/api#get-recent-trades</a>):</p>

<ul>
<li>Price</li>
<li>Volume</li>
<li>Time</li>
<li>Buy/sell</li>
<li>Market/limit</li>
</ul>

<p>All of these make sense except the last one, market/limit. How can a trade be a market trade or a limit trade? I am very familiar with market and limit orders, but I thought that every trade is a market order matched against one or more limit orders. So how can a trade be market or limit?</p>

<p>Can I perhaps treat a market sell trade as a limit buy trade and vice versa? And so it would just be random whether they call it market sell or limit buy? This would seem a little odd to me...</p>

<p>Any insight would be appreciated!</p>

CC BY-SA 4.0
2018-05-10T16:51:18.803Z
Hi Flecto. Building historical data from kraken as well. I'm looking for OHLCV for 1 minut as far as possible for BTCEUR. Do you have that?
Justme
CC BY-SA 4.0
2018-05-12T19:03:13.900Z
No, I didn't download BTCEUR, since I'm only interested in USD and crypto pairs. Here's the Python script I use to download trade data from Kraken: https://pastebin.com/jeP2QEUQ This dumps all the trades in an HDF5 file. I then use other code to aggregate the trades into 1 minute (or any other timeframe) OHLCV data. Hope this helps!
Flecto
CC BY-SA 4.0
2019-01-08T16:21:43.450Z
Hi @Justme, I may have what you need. Let me know on gilmijar at gmail.
Ilia Gilmijarow
<api><historical-trade-data><kraken>
Understanding Kraken Trades API (market/limit)
Flecto
# Understanding Kraken Trades API (market/limit)

(Asked by: username_0 on 2017-09-07)

I want to build historical OHLC data from the Kraken trades. Since Kraken does not provide historical OHLC data (at least not going far back), they recommend one builds it oneself using the list of trades (<https://support.kraken.com/hc/en-us/articles/218198197-How-to-pull-all-trade-data-using-the-Kraken-REST-API>). Their trades API does indeed return trades as far back as October 2013, but I do not understand how to interpret the data.

They return the following information for each trade (see <https://www.kraken.com/help/api#get-recent-trades>):

* Price
* Volume
* Time
* Buy/sell
* Market/limit

All of these make sense except the last one, market/limit. How can a trade be a market trade or a limit trade? I am very familiar with market and limit orders, but I thought that every trade is a market order matched against one or more limit orders. So how can a trade be market or limit?

Can I perhaps treat a market sell trade as a limit buy trade and vice versa? And so it would just be random whether they call it market sell or limit buy? This would seem a little odd to me...

Any insight would be appreciated!

**Tags:** api, historical-trade-data, kraken

> **Comments:**
> **username_1**: Hi username_0. Building historical data from kraken as well. I'm looking for OHLCV for 1 minut as far as possible for BTCEUR. Do you have that?  
> **username_0**: No, I didn't download BTCEUR, since I'm only interested in USD and crypto pairs. Here's the Python script I use to download trade data from Kraken: https://pastebin.com/jeP2QEUQ This dumps all the trades in an HDF5 file. I then use other code to aggregate the trades into 1 minute (or any other timeframe) OHLCV data. Hope this helps!  
> **username_2**: Hi @username_1, I may have what you need. Let me know on gilmijar at gmail.  

---

## 1 answers

### Answer by username_2 on 2017-11-01. Score: 3

Indeed they don't specify what it means, but the only sane option is that market/limit tag comes from the type of order that closed the deal.

For example there are two lowest sell(ask) orders hanging in the order book:

* 0.05 BTC at 2000 EUR
* 0.03 BTC at 2300 EUR

I come to Kraken and place a Market order, buy(bid) for 0.07 BTC, thus the first trade will be for 0.05 BTC, and the second will be for 0.02 BTC. Both will have designation 'market'.

It is possible, however that I want to buy some bitcoin, (let's say 0.9 BTC), but not higher than 2300 EUR. Then to make sure I don't pay more than planned, I make a LIMIT order and the two awaiting orders are matched to mine and what is left of my order amount may hang in the order book on the Buy side. In this scenario the trades as seen via API will have designation 'limit'


---

