There are a number of different ways we can go about collecting this data. Let’s examine some of the most popular strategies and the advantages and disadvantages of each strategy.

Calculate from Raw Data

Fundamentally, candlesticks are simply the culmination of each trade that is executed on a specific trading pair. That means you can technically construct the entire candlestick history yourself if you had the historic tick-by-tick trade data from the exchange. All you would need to do is follow these steps:

Tally up the volume from every trade in a given interval Calculate the min trade price for each interval Calculate the max trade price for each interval Calculate the open and close prices for each interval

This is by far the most time consuming method to constructing the historical candlestick data. Not to mention it would likely be pricey. This trade data could set you back anywhere from $1,000 to $100,000 depending on what vendor you decide to approach for the data.

Not to mention it would require a constant connection to every exchange to forward fill the data and create future candlesticks in real-time.

Every trade matters, so make sure you don’t miss one!

Download Candlesticks from Exchanges

The next popular option is to access the candlestick data directly from the exchange. That way you don’t need to do any of the heavy lifting of calculating the candlesticks yourself.

It should be a breeze right? Wrong!

In order to support candlesticks across every major exchange, you will need to follow these steps:

Write custom code to access the candlesticks across each exchange you want to integrate Normalize the candlesticks so you have consistent intervals across each exchange (exchanges don’t have consistent intervals they agree on) Manage incorrect labeling of assets, token swaps, forks, and rate limits which make it nearly impossible to manage more than a few exchanges at any given time Constantly update your code for each exchange as they release updates, modify conventions, or change the way they serve data

While calculating every candlestick by using the tick-by-tick data would be a nightmare, accessing the data directly from the exchange isn’t much better.

Exchanges in the cryptocurrency market are difficult to manage. Every exchange has a different set of standards and APIs. Some exchanges incorrectly mark assets or have poor conventions. In the end, it requires constantly updating your code.

To highlight the intensity of the situation, let’s take examples from a few exchanges.