How to create a Cryptocurrency Trading Bot in Node.js
- Cryptocurrency Basics
- Project length: 3h 48m
This tutorial will go through the process of creating a trading bot for Cryptocurrency using Node.js. The tutorial will focus on three Cryptocurrencies, Ether, Bitcoin & Litecoin. First, we’ll look at how to create a wallet for each of these currencies using the Coinbase API, and then add code in to successfully create transactions, finishing with a simple yet well known trading algorithm that also considers trading fee’s and 1 day rolling historical data. Once we’ve created our service, we’ll set it live with test money to see how it does, followed by real cash at the end.
This tutorial will go through the process of creating a trading bot for Cryptocurrency using Node.js. The tutorial will focus on Bitcoin as our currency of choice. First, we’ll look at how to create a wallet for each of these currencies using the Coinbase API, and then add code in to successfully create transactions, finishing with a simple yet well known trading algorithm that also considers trading fee’s and 90 day rolling historical data. Once we’ve created our service, we’ll set it live with test money to see how it does, followed by real cash at the end.
What are the requirements?
To get the most out of the tutorial, viewers should have some basic knowledge or understanding of:
- MongoDB or NOSQL
What is the target audience? Anyone who wishes to learn more about:
- Algorithmic trading
When are the streaming sessions (streaming schedule)?
Weekly 2pm EST New York time on Tuesday, Thursday
since starting this project I've learnt better ways to implement. Therefore, I will be starting again with the course over the next coming weeks with improvements to the trading bot and a new project following on from what we discovered up to Session 4.
Thanks for bearing with me!
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 Coinbase API key
- Using the Coinbase API key with the coinbase package
- Obtaining Bitcoin Prices
- Setting up a daemon using Forever
Session 2: Exchange Prices
Now we begin to look at pricing data, we want to store prices for a period of time and collect a price index at a specific interval. We can also use historical data provided by CoinDesk to start off our algorithm.
- Store Bitcoin prices in our database
- Retrieve a rolling window of prices given a date
- Find min, max, median & mode in our rolling windows
Session 3: Trading Algorithm
In this session we'll discuss trading algorithms and the various methods used in the industry, then implement one or two of the most used algorithm for our use case with Bitcoin. Once that's done, we'll run our algorithm against some historical data and see what happens.
- Looking at various trading algorithms
- Implementing one or two commonly used trading algorithms
- Testing our trading algorithms
Session 4: Transactions
Once we're confident our algorithm is producing results we'd like to see, we'll start to look at applying transactions using the Coinbase API. We'll also take into account Service fees in order to make sure we are running at a profit.
- Creating and retrieving a bitcoin Wallet
- Costing service fees
- Applying our algorithm into a desired buy and sell price
- Registering our transaction with coinbase
Session 5: 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 6: 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.