- A Real-Time Bitcoin Trading Bot
Table of Contents
A bitcoin trading bot that is trained on live dataset from Binance using the Binance API. The bot is trained on the live data using LSTM Deep Learning and uses that prediction to make its move in the market. The bot is capable of both buying and selling Bitcoin according to the situation of the market. The bot is also capable of transfer learning in order to improve its accuracy.
- Clone the repo or download the zip folder to your local machine.
- Install Python and all dependencies on your machine.
- Train your model using the "Training Using LSTM" notebook.
- Using that model, you can trade on your Binance account through the "Trading" notebook.
First of all, you need a binance account to trade on the platform. Sign up on:
https://accounts.binance.com/en/register?return_to=aHR0cHM6Ly93d3cuYmluYW5jZS5jb20vZW4=
Fill in the required details, do all the necesssary authentication and you are good to go!
After that, Create the Binance API for your account. In your account settings, go to API Management, label your API, and press Create.
After you complete all verification and create your API, you will get the following screen:
This API Key and Secret Key are the essentials required to use the Binance API in Python. Store them on a safe file (NOTE: THE SECRET KEY IS ONLY DISPLAYED ONCE WHEN THE API IS CREATED. STORE IT IN AN EXTERNAL FILE AS IT WILL NOT BE SHOWN AGAIN.)
Once you have completed all the steps above, you have setup your Binance Account and API and are ready to run your trading bot! In order to run this bot on your python environment, run the following lines on your Python/Anaconda command line to install the required dependencies:
pip install numpy
pip install pandas
pip install matplotlib
pip install scikit-learn
pip install Keras
pip install python-binance
Once you install all the dependencies, open the Jupyter Notebook, run the bot and start trading!
Displaying the Candlesticks data loaded from Binance API:
Standardizing the dataset and loading the dataset into a Pandas Dataframe:
Tuning the hyperparameters and compiling the training model
Tuning the hyperparameters and compiling the training model
Evaluating the accuracy of the model:
Using the trading model to trade real-time on the Binance Platform:
Distributed under the MIT License. See LICENSE
for more information.
Hassan Raza - https://www.linkedin.com/in/hassan-raza-mahmood/ - [email protected]
Project Link: https://github.com/HassanRaza1313/Bitcoin-Trading-Bot-Using-LSTM