ccxt /binance-trade-bot

Automated cryptocurrency trading bot

★ 8,826⑂ 2,262👁 310⑃ 260● 356▤ 1
PythonGPL-3.0Created 2019-07-12
TA的项目
下载:v1.0.1v1.0.1 ↓1.0.12025-02-28
+0
日增长
8,826
stars
2,262
forks
310
watchers
260
prs
356
issues
1
releases

README

Binance Trade Bot
 An automated cryptocurrency trading bot for Binance

 Author
Created by Eden Gaon




 Project Status



 Quick Deploy



 Community
Join our growing community on Telegram to discuss strategies, get help, or just chat!



 Community Telegram Chat
https://t.me/binancetradebotchat

 Why?

This project was inspired by the observation that all cryptocurrencies pretty much behave in the same way. When one spikes, they all spike, and when one takes a dive, they all do. _Pretty much_. Moreover, all coins follow Bitcoin's lead; the difference is their phase offset.

So, if coins are basically oscillating with respect to each other, it seems smart to trade the rising coin for the falling coin, and then trade back when the ratio is reversed.

 How?

The trading is done in the Binance market platform, which of course, does not have markets for every altcoin pair. The workaround for this is to use a bridge currency that will complement missing pairs. The default bridge currency is Tether (USDT), which is stable by design and compatible with nearly every coin on the platform.


  Coin A → USDT → Coin B


The way the bot takes advantage of the observed behaviour is to always downgrade from the "strong" coin to the "weak" coin, under the assumption that at some point the tables will turn. It will then return to the original coin, ultimately holding more of it than it did originally. This is done while taking into consideration the trading fees.


  Coin A → USDT → Coin B
  Coin B → USDT → Coin C
  ...
  Coin C → USDT → Coin A


The bot jumps between a configured set of coins on the condition that it does not return to a coin unless it is profitable in respect to the amount held last. This means that we will never end up having less of a certain coin. The risk is that one of the coins may freefall relative to the others all of a sudden, attracting our reverse greedy algorithm.

 Binance Setup

-   Create a Binance account (Includes my referral link, I'll be super grateful if you use it).
-   Enable Two-factor Authentication.
-   Create a new API key.
-   Get a cryptocurrency. If its symbol is not in the default list, add it.

 Tool Setup

 Install Python dependencies

Run the following line in the terminal: pip install -r requirements.txt.

 Create user configuration

Create a .cfg file named user.cfg based off .user.cfg.example, then add your API keys and current coin.

The configuration file consists of the following fields:

-   api_key - Binance API key generated in the Binance account setup stage.
-   api_secret_key - Binance secret key generated in the Binance account setup stage.
-   testnet - Default is false, whether to use the testnet or not
-   current_coin - This is your starting coin of choice. This should be one of the coins from your supported coin list. If you want to start from your bridge currency, leave this field empty - the bot will select a random coin from your supported coin list and buy it.
-   bridge - Your bridge cur

Top issues

Latest release

v1.0.1 v1.0.1 2025-02-28

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON