Cryptocurrency Trading Bot With User Interface In Python

Automate Your Crypto Trading Strategies on Binance & Bitmex with Python and Create Your Own Trading Dashboard (GUI)

Last updated 2022-01-10 | 4.6

- How to Code a trading bot / Automate a trading strategy
- How to Connect to crypto exchange APIs in general
- How to Design a graphical user interface (GUI) in Python

What you'll learn

How to Code a trading bot / Automate a trading strategy
How to Connect to crypto exchange APIs in general
How to Design a graphical user interface (GUI) in Python
Improve your Python skills and good practices with a real-world project
Learn to use a REST and Websocket API

* Requirements

* Basic Python knowledge (know what a class/object is
* dictionaries
* lists
* functions
* loops
* etc.)
* Basic knowledge about crypto trading (bid/ask price
* limit/market order)

Description

Take your trading ideas to code and make them more efficient by automating them like a pro!

This course will guide you through all the steps required to write a program in Python for algorithmic trading, using the best coding practices. It is a perfect example of the "learning by doing" pedagogy: instead of learning only theoretical concepts, you will learn important concepts whilst creating a real trading application, from API connections to trade management.


Keep control over your trading robot with an interface

A trading program can automate your strategy, but that's not all: you can also use it as a trading assistant by building a user interface (UI) that will help you follow your trades and market data. This course will give you an understanding on how to develop a solid Tkinter interface and integrate it with the trading automation part.


Interact with the crypto exchange servers without an intermediary

Many platforms propose to write simplified code to automate your strategy and handle most of the interaction with an exchange API in the background. It doesn't give you the freedom you may need, it prevents you from building very developed programs, and their service- of course- isn't easy on the wallet.
This course will teach you how to interact with an exchange API without an intermediary- giving you control of everything. It will also give you the power to improve your programming knowledge, which you can re-use for other projects.


Learn with the Binance Futures and Bitmex APIs

Binance and Bitmex are two of the most popular crypto exchanges in the world, they provide awesome automation possibilities and are great for beginners. You can then apply what you have learned to your Binance Spot/Margin account or other exchanges.

Both Binance and Bitmex have testing environments, including their API, which is a great way to learn!

Who this course is for:

  • Traders wishing to automate their strategies
  • Python developers wanting an introduction to trading bots
  • Developers wanting an introduction to GUI programming in Python
  • Python beginners who want to learn about GUI programming and API connections with a real-world project
  • Binance and Bitmex users who want to create their own trading tools

Course content

8 sections • 66 lectures

Course Overview Preview 09:10

This lecture will help you to understand the course organization and goals.

Installing Python Preview 01:16

Download Python, install it and check that it is working.

Installing and Using Pycharm Preview 07:44

Creating your API Keys (mandatory) Preview 04:44

Tutorial to create your API keys on the exchanges, and security recommendations.

Frequently Asked Questions (FAQ) Preview 01:50

Stuck during the course? Check here Preview 00:20

Creating an Entry Point | Logger | Main window Preview 13:34

This lecture explains the roots of the program, how to create the interface, the logging messages and how to start the program. The elements presented it in will be used all along the course.

Interacting with a public API Preview 14:11

Understand what an API is and start using the Binance Futures API.

Use the Bitmex API

Displaying API data on an interface Preview 10:07

Start combining what you know about the interface and the APIs.

Introduction to widget styling Preview 04:46

Learn some basics to make your interface look better.

Binance Futures - REST API (Public endpoints coding) Preview 21:42

Create an API client class and start parsing various data from Binance Futures.

Binance Futures - REST API (Public endpoints testing) Preview 02:56

Binance Futures - REST API (Private endpoints) Preview 22:19

Learn how to perform operations on your account using the authenticated requests.

Binance Futures - Websocket API Preview 17:03

Learn to stream market data in your program using the Websocket API.

Binance Futures - Improvements: Data Models & Variable Typing Preview 17:45

Make your code more efficient and more readable thanks to data models and data typing.

Binance Futures - Improvements: Error Handling & Private variables/methods Preview 09:42

Make your code more reliable with various error handling methods.

Subscribing to more Websocket channels Preview 02:22

Subscribe to all the Binance symbols without jeopardizing the connection.

Exercise: Creating a basic Bitmex connector Preview 00:26

Bitmex - REST API & Authentication Preview 24:47

Bitmex - REST API: Adding more functions Preview 16:41

Bitmex - Websocket API Preview 05:31

Connect and subscribe to the Bitmex websocket channels.

Convert a date-time string to an Unix Timestamp Preview 08:31

Use the python-dateutil and datetime libraries to manipulate ISO 8601 strings.

Solving the problem of the order price and quantity rounding Preview 08:43

The source code of the course is available in this Lecture ressources!

Parent Component & Interface organization Preview 07:29

Create and understand the Root component that will be used to host the other components.

Logging Component Preview 10:53

Create your first component and learn how to display logging message directly in the interface.

Updating the User Interface safely Preview 10:24

Update information in the interface and avoid one of the big traps when coding Tkinter applications.

Watchlist Component: Structuring the Class Preview 17:30

Create the Watchlist Component and prepare the methods/variables that it will use.

Watchlist Component: Adding a Symbol Preview 06:51

Add a new row to your Watchlist and check that what the user types is right.

Watchlist Component: Removing a symbol Preview 05:55

Add a Tkinter Button to remove the symbol from the Watchlist.

Watchlist Component: Updating the Watchlist Preview 12:49

Use the collected bid/ask price to update the Watchlist with the udpdate_ui() method.

Exercise: Creating the Trades Component Preview 00:43

Trades Component Preview 10:51

Nothing very new in this part, but still necessary before coding the trading functionalities!

Strategy Component: Initialization Preview 06:11

Prepare the Strategy Component command button and table with headers.

Strategy Component: Adding a new strategy Preview 16:37

Add the widgets when clicking the "Add strategy" button.

Strategy Component: Deleting a strategy Preview 03:57

Delete the strategy when clicking the X button and learn about a tricky "lambda" function behavior in for loops.

Strategy Component: Configuring additional parameters Preview 13:47

Create a pop up window that will display additional parameters specific to the strategy chosen.

Strategy Component: Validating the additional parameters Preview 08:54

Save the additional parameters in a variable so that they can be reused in other methods.

Strategy Component: Switching the strategy On/Off Preview 16:19

Learn how to activate your strategy and be ready to trade!

Source Code Preview 00:03

Using classes to organize the strategy module Preview 10:22

You will learn how to organize your strategy module using a parent strategy class.

Candlestick data: Parsing trades data Preview 07:59

Request historical data and subscribe to trade updates.

Candlestick data: Updating the list of candlestick data Preview 16:25

Update your historical candlesticks with live websocket data.

Coding the Breakout Strategy Preview 04:15

Code the first strategy of the bot, based on candlestick patterns.

Calculating the Technical Strategy indicators Preview 14:09

Use pandas to calculate the MACD and RSI.

Adding more conditions for entering a Trade or not Preview 05:28

Trigger the check_signal() methods based on the websocket trade updates.

Calculating the trade size on Binance and Bitmex Preview 13:07

Use the strategy parameters and the information about your current account balance to calculate the trade size. The Bitmex case is more complex because you have to take into account the contract type (quanto, inverse...).

Trade Execution Preview 17:09

Finally time to place the order! In this lecture, we will check that the order was placed successfully, monitor the execution and create a new data model containing information about the trade.

Displaying the PNL and Trade in the interface Preview 15:43

Use the update_ui() method to update the Trade component.

Take Profit, Stop Loss, and Trade exits Preview 06:43

Complete the trade cycle by exiting a position when the TP or SL is hit.

Source Code Preview 00:03

Mac Users: Customize the Tkinter Buttons Preview 03:51

Adjust Tkinter widgets to improve their appearance on Mac.

Data Entry validation Preview 09:08

Create validation callback functions to make sure the user can type only a specific type of characters in the Entry widgets.

Auto-complete Entry widgets Preview 17:44

Adding scrollable frames: the basics Preview 15:55

Adding scrollable frames: a more complex case Preview 14:17

Closing the application Preview 05:10

Learn to properly close a Tkinter application.

Starting the application outside of Pycharm Preview 02:27

Create an executable file to start your program without opening Pycharm.

Creating an SQLite database Preview 10:14

Create a database to store useful information related to your program.

Saving your workspace to the database Preview 18:30

Create a menu widget and use the get() | save() methods to save and then load your workspace.

Creating a requirements.txt file Preview 01:16

Integrating Binance Spot Preview 05:13

Leads to integrate the Binance Spot API to your program.

Binance Spot Tesnet: Generating API keys Preview 00:30

Handling the Binance Spot Websocket limitations / Resubscribe to the channels Preview 10:08

Subscribe to the bookTicker and aggTrade updates on an individual basis.

Final words and advice Preview 03:03

Conclusion about the course and advice to take your own ideas to code.

Source Code with Comments Preview 00:06