Create a reliable script to extract historical trade data from Binance
Note: this article is provided for entertainment and educational purposes only and is not intended as financial advice.
As an ex-CTO of a cryptocurrency exchange, I had my fair share of messing around with several major exchanges’ APIs. In this article, I will guide you through the process of creating a reliable Python script to extract historical trade data from Binance.
When backtesting a trading strategy, that is, for executing our strategy with past data and analyzing the returns and other important factors, we have to make sure that we have the appropriate kind of data to work with. The process isn’t always so simple, given that some strategies need level book data, others may do just fine with one-hour candles, and elements like infrastructure, availability, and connectivity can be a lot different depending on the type of data that you need.
There’s no need to worry if you don’t have the slightest clue about what these level book data or one-hour candles means, as we will not be touching on those in this article.