Cryptocurrency Trading Bot with a User Interface in Python
- Description
- Curriculum
- FAQ
- Reviews
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!
-
1Course Overview
This lecture will help you to understand the course organization and goals.
-
2Installing Python
Download Python, install it and check that it is working.
-
3Installing and Using Pycharm
-
4Creating your API Keys (mandatory)
Tutorial to create your API keys on the exchanges, and security recommendations.
-
5Frequently Asked Questions (FAQ)
-
6Stuck during the course? Check here
-
7Creating an Entry Point | Logger | Main window
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.
-
8Interacting with a public API
Understand what an API is and start using the Binance Futures API.
-
9Use the Bitmex API
-
10Displaying API data on an interface
Start combining what you know about the interface and the APIs.
-
11Introduction to widget styling
Learn some basics to make your interface look better.
-
12Binance Futures - REST API (Public endpoints coding)
Create an API client class and start parsing various data from Binance Futures.
-
13Binance Futures - REST API (Public endpoints testing)
-
14Binance Futures - REST API (Private endpoints)
Learn how to perform operations on your account using the authenticated requests.
-
15Binance Futures - Websocket API
Learn to stream market data in your program using the Websocket API.
-
16Binance Futures - Improvements: Data Models & Variable Typing
Make your code more efficient and more readable thanks to data models and data typing.
-
17Binance Futures - Improvements: Error Handling & Private variables/methods
Make your code more reliable with various error handling methods.
-
18Subscribing to more Websocket channels
Subscribe to all the Binance symbols without jeopardizing the connection.
-
19Exercise: Creating a basic Bitmex connector
-
20Bitmex - REST API & Authentication
-
21Bitmex - REST API: Adding more functions
-
22Bitmex - Websocket API
Connect and subscribe to the Bitmex websocket channels.
-
23Convert a date-time string to an Unix Timestamp
Use the python-dateutil and datetime libraries to manipulate ISO 8601 strings.
-
24Solving the problem of the order price and quantity rounding
The source code of the course is available in this Lecture ressources!
-
25Parent Component & Interface organization
Create and understand the Root component that will be used to host the other components.
-
26Logging Component
Create your first component and learn how to display logging message directly in the interface.
-
27Updating the User Interface safely
Update information in the interface and avoid one of the big traps when coding Tkinter applications.
-
28Watchlist Component: Structuring the Class
Create the Watchlist Component and prepare the methods/variables that it will use.
-
29Watchlist Component: Adding a Symbol
Add a new row to your Watchlist and check that what the user types is right.
-
30Watchlist Component: Removing a symbol
Add a Tkinter Button to remove the symbol from the Watchlist.
-
31Watchlist Component: Updating the Watchlist
Use the collected bid/ask price to update the Watchlist with the udpdate_ui() method.
-
32Exercise: Creating the Trades Component
-
33Trades Component
Nothing very new in this part, but still necessary before coding the trading functionalities!
-
34Strategy Component: Initialization
Prepare the Strategy Component command button and table with headers.
-
35Strategy Component: Adding a new strategy
Add the widgets when clicking the "Add strategy" button.
-
36Strategy Component: Deleting a strategy
Delete the strategy when clicking the X button and learn about a tricky "lambda" function behavior in for loops.
-
37Strategy Component: Configuring additional parameters
Create a pop up window that will display additional parameters specific to the strategy chosen.
-
38Strategy Component: Validating the additional parameters
Save the additional parameters in a variable so that they can be reused in other methods.
-
39Strategy Component: Switching the strategy On/Off
Learn how to activate your strategy and be ready to trade!
-
40Source Code
-
41Using classes to organize the strategy module
You will learn how to organize your strategy module using a parent strategy class.
-
42Candlestick data: Parsing trades data
Request historical data and subscribe to trade updates.
-
43Candlestick data: Updating the list of candlestick data
Update your historical candlesticks with live websocket data.
-
44Coding the Breakout Strategy
Code the first strategy of the bot, based on candlestick patterns.
-
45Calculating the Technical Strategy indicators
Use pandas to calculate the MACD and RSI.
-
46Adding more conditions for entering a Trade or not
Trigger the check_signal() methods based on the websocket trade updates.
-
47Calculating the trade size on Binance and Bitmex
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...).
-
48Trade Execution
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.
-
49Displaying the PNL and Trade in the interface
Use the update_ui() method to update the Trade component.
-
50Take Profit, Stop Loss, and Trade exits
Complete the trade cycle by exiting a position when the TP or SL is hit.
-
51Source Code
-
52Mac Users: Customize the Tkinter Buttons
Adjust Tkinter widgets to improve their appearance on Mac.
-
53Data Entry validation
Create validation callback functions to make sure the user can type only a specific type of characters in the Entry widgets.
-
54Auto-complete Entry widgets
-
55Adding scrollable frames: the basics
-
56Adding scrollable frames: a more complex case
-
57Closing the application
Learn to properly close a Tkinter application.
-
58Starting the application outside of Pycharm
Create an executable file to start your program without opening Pycharm.
-
59Creating an SQLite database
Create a database to store useful information related to your program.
-
60Saving your workspace to the database
Create a menu widget and use the get() | save() methods to save and then load your workspace.
-
61Creating a requirements.txt file
-
62Integrating Binance Spot
Leads to integrate the Binance Spot API to your program.
-
63Binance Spot Tesnet: Generating API keys
-
64Handling the Binance Spot Websocket limitations / Resubscribe to the channels
Subscribe to the bookTicker and aggTrade updates on an individual basis.