Introduction to Crypto Trading Bots with Python
Hello and welcome to my post discussing “building an automated cryptocurrency trading bot on Binance with Python”. I begun working on this project in April 2018 due to my interest in cryptocurrency trading, and my previous education and skills with python computer programming.
The goals for this project is to create an open-source software which will trade cryptocurrency on an exchange, such as binance, using strategies to maximize profit while reducing risk.
The main motivation for this project is to create an open-source crypto-trading software that anyone can download, edit & customize to implement their own trading strategies.
There exist many crypto trader bots available, but I believe that a solution where the code is open-source and can be customized to each trader’s goals, time horizon & risk profile is desirable.
Many of the available trading bots are proprietary, while others are in languages other than python (Such as Gekko Trading Bot Software). I wanted a python bot so I could run it on my own computer, and keep tight control over the private keys.
To gain a proper understanding of the goals of this project, please watch the introductory video below:
Cryptocurrency Trading: Numerous Opportunities (and Risks)
Problem: Cryptocurrency is a new form of money created around the year 2009 through a white-paper introduced by Satoshi Nakamoto to digitize and store ‘value’ through the internet, known as Bitcoin. Since this time, thousands of other cryptocurrencies have been created enabling a tremendous opportunity for future globally-facilitated transactions.
The current market valuation for all cryptocurrencies is near $400 billion USD at the time of writing, presenting a tremendous opportunity for growth of invested capital as evidenced by the drastic increase in cryptocurrency prices and market caps in 2017.
On the opposite side of this opportunity, the cryptocurrency market contains high volatility and numerous risks.
Much of the current wisdom about cryptocurrency investing is based around ‘buy & hodl’, but an automated solution is desired with the aims of preserving & increasing invested capital with limited trader involvement. Given the tremendous opportunity (and equally large risks involved), a software is desired to aid investment in cryptocurrency by both newbies & experienced cryptocurrency investors.
Design of Cryptocurrency Trading Software
Solution: A software solution is required which can invest funds in cryptocurrency markets (such as Binance) which will buy, sell and hold according to various strategies to increase profit in a way that is easily managed, highly reliable and autonomous.
How To Design Crypto Trading Bot in Python
Automated Trading Bots are very common on major stock exchanges such as the New York Stock Exchange due to their functionality, speed and pre-defined trading rules.
Example of ‘Scalping’ Trading Strategy Employed by Crypto Trading Bot with Price Entry/Exit
Crypto Trading Bot Youtube Series
In addition to blog posts and podcasts about this topic, I will create a new video series I will be doing on Youtube titled ‘How To Build an Automated Trading Bot (on Binance with Python)’, which is a technical guide to building a trading bot that will:
- Purchase and Sell cryptocurrency on the Binance Exchange in a way which maximizes Return on Investment while Reducing Risk.
- Portfolio Management- Create a daily/weekly/monthly profit & loss statement Tracking Wins & Losses, an ‘index’ of 25 largest Market Cap Coins.
- Easily customizable while ability to start running as packaged, varying time horizons, risk profile.
I am interested to create an automated algorithmic bot for trading cryptocurrencies due to the advantages of bots and the capabilities provided by software. I documented almost every portion of this journey so that anyone else who would like to modify or replicate the binance trader bot code would be well-informed on many of the design choices I made while building this bot.
Market Making Crypto Trading Bot in Python
Background Technical Analysis — Crypto Trading Reading
A Beginner’s guide to Crypto Trading Bots is available from Blockonomi.com which gives a fantastic overview of bots and the strategies implemented to provide profits.
Things I wish I knew when I started Crypto Trading
Crypto Trading. It brings with it some of the highest highs when you ride a rocket to the moon and the lowest lows when…
All My Trusty Crypto Trading Wisdom in One Spot
It seems more and more of you are tuning into my channel because of my crypto trading articles. That’s humbling and…
[ARBITRAGE] Agent Smith: Arbing the great bull run of 2017
Gekko Forum ›Gekko ›Custom Systems › [ARBITRAGE] Agent Smith: Arbing the great bull run of 2017
Current Cryptocurrency Trading Bots/Sites
The Best Open Source (and Free) Crypto Trading Bots
Crypto trading bots are tools used by traders to take the fear and emotion out of their trading. These bots allow you…
- https://cryptotrader.org/ —
Three major codes have been developed for trading on Binance with Python:
Chapter 2: Functionality of Cryptocurrency Trading Bot
Purchase — Sell — Trade Cryptocurrency Bot Features
Crypto-Signal will be incorporated in this project for TA Signal Analysis.
- Data Collection & Analysis
- Swing Trading
- Bollinger Bands — Stochastic RSI
- Blade Runner
- Varying Long-Medium-Short term focus strategies
- Protecting/Growing Capital Invested
- Bet-sizing based on high/low-risk strategies
- Ability to modify & test various strategies
- Create Youtube Series with coding explanation & introduction to cryptocurrency Trading/Technical Analysis (TA) — possible collaboration with Professional Cryptocurrency Traders & Developers
- Incorporate with Twitter/Discord to add functionality, such as placing an order through discord, or supply requested information
- Test various A.I. and Machine Learning based Technical Analysis
Chapter 1: Setting Up CryptoTrading Bot Environment in Python
- Download and Install PyCharm
- Download and Install all Libraries & Dependencies
- Download and Install Python-Binance library on Github
Chapter 2: Introduction to CryptoTrading Bot
- Buy & Sell Strategies
- Portfolio Management
- Risk Management
Chapter 3: Portfolio/Index Indicators
The focus of Chapter 3 is to add Portfolio functionality to the Automated Trading Bot on Binance project. Creating a portfolio is a straightforward exercise done in many college courses, so I would like to incorporate an already completed python project with significant functionality.
- Create Portfolio functionality of Cryptocurrencies with deposits, withdrawals, buy & sell — denominated in Satoshis — Daily/Weekly/Monthly Profit & Loss Reports
- Ability to create ‘play money’ portfolios, perform advanced portfolio tasks such as Indexing Cryptocurrency profile (Hodl Bot)
- All Data Saved to .csv files , can easily be edited in Microsoft Excel
- Incorporated with Pandas Data Structure for Data Analysis & Matplotlib for Data Visualization
A template design functionality with these features is available from “Tracking a Portfolio with Python” and all code published on github as ‘Portfolio Tracker’, which will be forked and modified for tracking Cryptocurrency Portfolio on Binance.
A great project called “Cryptrack by Herschee” is used for tracking a cryptocurrency portfolio with publicly available code, pulling from coinmarketcap to determine hourly/daily/weekly gains & losses. This code will be included in the algorithmic trading bot project as an initial functionality before implementing ‘Portfolio Tracker’ functionality.