Create a bot to automate trading and reduce trading risks on the Binance exchange.
About the product
In 2018, we received an order from a client to develop a trading bot based on a ready-made algorithm.
Cryptobot is an advanced Binance trading tool based on the Stop Loss algorithm. By design, it should automatically track changes on the market. The idea is to buy cryptocurrency cheaper and then sell it with profit.
It is operated by the trader in a semi-automatic mode.
UX interface diagram
It took a total of 40 days to develop.
Over this time we • Created an interface for the bot. • Implemented transaction history. • Enabled algorithms for specific pairs. • Connected the Binance API to track statistics. • Developed several selling and buying algorithms. • Made a button for bulk sale of all assets in the selected currency pair. • Configured the bot to work with several currency pairs: BTC / LTC, ETH / BTC.
Technical algorithm of the bot
The trading algorithm is intended for trading on the M5 timeframe (also suitable for M15 and M3, but mainly M5). The algorithm is based on trend strategies and shows the best results specifically in the bull/bear trend.
In lateral motion (flat) it results in many unprofitable trades with a small % loss. Therefore, the algorithm is not perfect and helps to take advantage of a concrete trend. It is important to make sure that the profit the bot makes on the trend exceeds the losses during the flat.
Ideally, the bot is operated manually: the trader determines the beginning or continuation of the trend, turns on automatic trading, and turns it off during the flat.
The algorithm consists of: • exponential moving - average with a period of 13 (at the price of Close) - EMA13 (fast); • exponential moving- average with a period of 34 (at the price of Close) - EMA34 (slow); • exponential moving - average with a period of 89 (at the price of Close) - EMA89 (filter); • standard CCI indicator with a period of 20 and levels of 50 and -50; • standard MACD indicator (12 - 26 - 9); • standard RSI indicator with period 14 and levels 45 and 55.
The technical algorithm for opening a purchase transaction looks like this: • fast EMA13 is higher than slow EMA34 and they are both higher than filtering EMA89; • CCI 20 is above the zone 50… -50; • MACD crossed the zero line and went above 0; • RSI 14 is above zone 45-55.
The technical algorithm for opening a sales transaction mirrors the purchase algorithm.
We decided to combine this algorithm with the already existing Bot algorithm №1 - when the stop loss % and the take profit % are set manually for the Bot, and it starts trading with the preset Profit / Loss values.
Setting profit limits (similar to the trailing stop) and work on limiting losses in the side market is performed automatically. Therefore it helps to make sure the total amount of profit in the trend exceeds the frequent and small losses during the flat period.
The bot is configured to work with several currency pairs.
The user tracks the rate changes on Binance through the statistics window.
A semi-automatic trading bot for the Binance exchange was successfully developed.
Ruby on Rails
Evgeniy Zaydenberg Alexander Makarov Nikolay Melnik