5
1
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!
1Hi 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 – 2018-05-10T16:51:18.803
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 – 2018-05-12T19:03:13.900Hi @Justme, I may have what you need. Let me know on gilmijar at gmail. – Ilia Gilmijarow – 2019-01-08T16:21:43.450