Visit LEDU token page

How to Build Advanced Cryptocurrency Trading Bot in Node.js

How to Build Advanced Cryptocurrency Trading Bot in Node.js

  • English
  • Cryptocurrency
  • Cryptocurrency BasicsCryptocurrency Basics
  • (7469)
  • Project length: 7h 24m

This tutorial will go through the process of creating an advanced trading bot for Cryptocurrency using Node.js. The tutorial will focus on three Cryptocurrencies, Ether, Bitcoin & Litecoin. First we'll look at how to interface with the GDAX API in order to gain historical data for transactions, then we'll look at backtesting using this data and with custom strategies which use technical indicators. Once we've found a strategy that works with the data we have, we'll then look to building out making trades within GDAX and estimating fees and cost. GDAX: GDAX API:


Project Introduction:

This tutorial will go through the process of creating a trading bot for Cryptocurrency using Node.js. The tutorial will focus on Bitcoin and Ethereum as our currencies of choice and will use the GDAX api.

First, we'll look at getting data from the GDAX api. Including setting up an account and accessing an api key. Then we'll look to use that data and create a trading strategy, setting up with backtesting so we can test our examples. Then we'll implement communicating our buy and sell signals with GDAX and finally we'll run live with real money if our strategy works well.

What are the requirements?

To get the most out of the tutorial, viewers should have some basic knowledge or understanding of:

  • Javascript
  • Nodejs
  • MongoDB or NOSQL
  • Docker

What is the target audience? Anyone who wishes to learn more about:

  • Algorithmic trading
  • Bitcoin
  • Ethereum
  • Litecoin
  • APIs
  • Nodejs
  • MongoDB

You should also take a look at the beginning course on setting up a trading bot here on LiveEDU which covers a basic trading bot implementation.

When are the streaming sessions (streaming schedule)?

Weekly 1pm EST New York time on Tuesday, Thursday

Project Outline

Session 1: Setting-up the Project

Looking at the starter point for our node project, obtaining a Coinbase API key and making our first request to the API.

  • Getting a GDAX API key
  • Using the GDAX API key with the gdax package
  • Obtaining Bitcoin and Ethereum historical Prices

Session 2: Historical Prices

We want to obtain historical pricing data so that we can see which strategy will work best when running our algorithms. We also want to make sure that any strategy we use will work correctly.

  • Obtain historical data with command line parameters
  • Getting a specified date range with historical data
  • Creating candlesticks with our data.

Session 3: Backtesting

In this session, we'll implement our backtesting. This will allow us to run the bot using historical data to see how well our strategy works. We'll also create some pretend signals to see this in action.

  • Retrieving data from GDAX
  • Writing our backtester and putting a strategy framework in place.

Session 4: Technical Indicators & Strategies

In this session we'll discuss technical indicators and their uses in trading algorithms. We'll then start to look at creating a basic strategy using one indicator.

  • Looking at various technical indicators
  • Implementing one to create a simple trading strategy.
  • Adding a stop loss to our strategy.

Session 5: Running Live

In this session we'll modify our code so that we can run live. In order to do this we'll need to change our algorithm so that it can run with developing candlesticks as well as historical fixed candlesticks and that our buy and sell signals will call the GDAX api. We also want to create a socket feed with GDAX so that we can get the most up to date data in real time, giving us a competitive edge.

  • Implementing the developing Candlestick
  • Adding in the socket feed for prices.

Session 6: Orders

In this session we'll look at implementing our strategy to our live data feed and then posting orders on our buy and sell signals.

  • Using a serial queue.
  • Learn about Market & Limit Orders
  • Adding calls to gdax to create market and limit orders
  • Tying our strategy signals to our trader for orders.

Session 7: Deployment

It's time to deploy! In this session we'll load our trading bot into Docker and then begin to run it in the cloud via Digital Ocean using a virtual wallet.

  • Creating a Docker image
  • Uploading onto Digital Ocean
  • Running our app with a virtual wallet & currency

Session 8: Results & Overview

We'll review the results of our virtual wallet and see if we made a profit or loss, if we made a profit, we'll start up with some real money and see how it does.

  • Look at the results of our test data app and see how well we did
  • Run with a live wallet if all went well.


Average rating

5(7469 Reviews)
  • Avatar


    4 years ago

    I really recommend this project to anyone interested in cryptocurrency.

  • Avatar


    4 years ago

    My skill in Node.js was greatly improved after watching this.

  • Avatar


    4 years ago

    This project is amazing! We need more projects like this, Node.js is very big currently.

  • Avatar


    3 years ago


  • Avatar


    3 years ago

    Desafiante!! i get lost at the 5th session. UPDATE: passed the 5th session ( a silly gramatical mistake). Session 6 is more brutal.

  • Avatar


    3 years ago

    Thanks for this! Re Session 2 (~17:00): For anyone using Windows PowerShell with default settings may see no dates being logged to console. It's just because the text is shown in the same color as the background. Change the background color to see the text.

  • Avatar


    2 years ago

    The video doesn't work. Here is the error message I had on the video player: "The media could not be loaded, either because the server or network failed or because the format is not supported." Can anybody help to fix this?