It’s been a week since the I shared the Binance Volatility trading bot with you in my recent blog post and I’m excited to share some good news regarding the development of this project.
The trading bot caught the attention of quite a lot of people and we now have an active GitHub developer community, pushing constant updates and improvements to the bot! I would like to thank every who has contributed on GitHub to improving the functionality of this bot.
Following this boom in developer activity on GitHub, there have been quite a few substantial changes to the code, as well as the way it works. In this article, I will be walking you through the main changes and improvements, as well as how to configure your bot.
But first a quick description of the bot:
This trading bot will automatically place trades on the Binance exchange by detecting the most volatile coins in a given timeframe.
- The bot will listen to changes in price across all Coins on Binance paired to USDT
- We’re excluding Margin (like BTCDOWNUSDT) and Fiat pairs
- The bot checks if the any coin has gone up by more than 3% in the last minute
- The bot will buy 100 USDT of the most volatile coins on Binance
- The bot will sell at 2% profit or 2% stop loss
Main updates to the Binance Volatility Trading Bot
- Trailing stop loss
- Better testing environment
- Easier configuration options
- Bugfixes and quality of life improvements
These are all easily configurable, and I encourage you to play with these parameters around.
Naturally, you will need a Binance account, so if you don’t have one or would like to use a different account for your bot, use my referral link to get 5% off of your commission fees. Next up is generating an API Key and Secret. You can do that by navigating over to your account > API Management. My previous post includes a step-by-step guide on how to generate API Keys for Binance so follow this link if you need more guidance on how to do it.
I’m first going to cover how to download and run this bot, then we can nerd-out on the configuration options for it.
Running the bot on your machine
The first thing you want to do is download the source code for the Binance Volatility Trading bot from GitHub by clicking on Code and then Download ZIP. Note that you need Python and the pip installer on on your machine in order to run the code and install dependencies.
Extract the archive and proceed to install the required dependencies from the requirements.txt file
In your cmd/ terminal you have two ways you can go about it:
- The easy way:
- The preferred way:
Configuring your bot
Once the dependencies are all out of the way, go ahead and open the creds.example.yml file and paste in your Binance API Key and Secret, and save the file as creds.yml in the same directory. You can open .yml files with any text editor including Notepad.
Now it’s time to configure our Binance Volatility Bot, by giving it some parameters. The bot comes with a predefined trading strategy, but you’re free to modify this as you see fit. In fact I encourage you to do so (in Test mode) so you can see potential profits/losses on different strategies.
So fire up the config.yml and I’ll walk you through the configuration options at your disposal.
- TEST_MODE – by default set to True, it will simulate live trades without actually placing trades or using real money. Set this to False (at your own risk) and the bot will use your live account and real funds – so be particularly careful here.
- LOG_TRADES – by default set to True, it will create a trades.txt file that contains a history of all the trades placed.
- LOG_FILE allows you to change the name of the file created by LOG_TRADES
- PAIR_WITH – by default USDT, you may choose to pair with any other fiat or coin
- QUANTITY – the amount to buy in the Pairing chosen above. Be sure to adjust this if you use a different pairing. 15 USDT is very different from 15 BNB.
- FIATS – a list of fiats and margin symbols to exclude. If you’ve changed PAIR_WITH, be sure to replace USDT here too.
- MAX_COINS – the maximum amount of coins that the bot will hold. It won’t buy more until it sells some of what it bought.
- TIME_DIFFERENCE – the amount of time in MINUTES to check the difference in price against. The minimum is currently 1 minute.
- RECHECK_INTERVAL – the number of times to check how existing trades are doing during the TIME_DIFFERECE. For example, a RECHECK_INTERVAL of 10 would check the stop loss & Take profit thresholds 10 times in 1 minute.
- CHANGE_IN_PRICE – the threshold in % that signals a buy
- STOP_LOSS – the fixed, inital stop loss in %
- TAKE_PROFIT – the fixied, inital take profit
- USE_CUSTOM_LIST – by default False, the bot will look at all the coins listed on Binance. Set to True to only look at the top 100.
- USE_TRAILING_STOP_LOSS – by default True. The bot will increate the stop loss as the price increases, allowing you to ride price increase as long as the increase continues. This should make up for higher gains, so it’s recommended you leave it to True.
- TRAILING_STOP_LOSS – the % increase that dictates when the stop loss will be moved up.
- TRAILING_TAKE_PROFIT – the % increate dictating when a new TAKE_PROFIT threshold is updated.
- TRADING_FEE – allows you to adjust this to the current trading fee on your account, in order to provide more accurate profit/loss estimations.
- SIGNALLING_MODULES – enables the use of custom modules, that can run in parallel to the main script. Read more about signalling modules in my latest blog post on the Binance Volatility Trading bot.
Keeping track of transactions
By default the Binance Volatility Bot will generate and update a text file (trades.txt) that contains all trading activity and the gains/losses of each trade.
coins_bought.json is used by the bot in order to keep track of coins it already bought, and won’t rebuy until sold.
That’s pretty much it, good luck!
Lastly, keep an eye out for further updates and improvements or join our Discord!