1DES logo
Cognitrade
arrow_forward_ios

How to Design a Machine Learning Trading Bot - Part 1: Data Collection

Bahman

Published on Jan 01, 2020

Trading with machine learning has just started, and many people want to know more about it. In this series of articles, I’ll explain how to design and develop intelligent automation for market trading.

This is the first episode in the series “How to design a machine learning trading bot”.

In this article, we are going to design a pipeline. We won’t develop a trading program yet. First, we make a plan—then, in the next season, we’ll implement it.

Here is the table of contents for upcoming articles:

Before starting development, it’s crucial to have a clear idea of what you want to do and implement.

Step 1: Collecting Data

Which market do you want to trade? Crypto, Forex, or Stocks? Before starting, make sure you have the right data in hand. For this sample, we’ll focus on the cryptocurrency market.

In crypto, each exchange has slightly different data, but most follow the main market trends. I suggest starting with one of the major exchanges, like Binance. Then, choose your pair—e.g., Bitcoin/USD or Bitcoin/EUR. In this article, we use BTC/USDT on Binance.

Now, we need two things:

  1. Collect live data from Binance.
  2. Get historical data of BTC/USDT on Binance. (Many websites and services provide free historical data.)

Why do we need historical data, and why start collecting data now? Because we’ll use historical data for analysis and pattern recognition. And we’ll use live-collected data for predictions during model building.

Before finishing, let’s clarify what data we expect.

OHLCV

OHLCV stands for:

  • O: Open Price
  • H: High Price
  • L: Low Price
  • C: Close Price
  • V: Volume

For this series, I recommend collecting 1-minute (1m) OHLCV data frames.

In the next season (Development), we’ll show how to programmatically collect 1m OHLCV from BTC/USDT.

TRADING MACHINE LEARNING DATA COLLECTION