explaingit

chrisleekr/binance-trading-bot

5,507JavaScriptAudience · developerComplexity · 4/5Setup · hard

TLDR

An automated cryptocurrency trading bot for Binance that uses trailing grid trading to chase price lows when buying and price highs when selling across multiple coins simultaneously, running in Docker on Linux or Raspberry Pi.

Mindmap

mindmap
  root((repo))
    What it does
      Auto crypto trading
      Trailing grid orders
      Multi-coin watching
    Tech Stack
      JavaScript
      MongoDB
      Docker
      TradingView
    Strategy
      Trailing buy logic
      Multi-round grid buy
      Trailing sell logic
    Setup
      Binance API key
      Docker required
      Linux or Pi 4
    Features
      Checks every second
      Averaged buy price
      Partial sell rounds
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Automate trailing buy orders that follow a coin price downward and execute when it bounces back up past a threshold

USE CASE 2

Set up multi-round grid buying so the bot invests larger amounts at each successive price dip and averages the cost

USE CASE 3

Run a self-hosted trading bot on a Raspberry Pi 4 that monitors multiple coins every second and survives restarts via MongoDB

Tech stack

JavaScriptNode.jsMongoDBDockerTradingView

Getting it running

Difficulty · hard Time to first run · 1h+

Requires a Binance account with API keys, Docker, and MongoDB all configured before the bot can trade, no profit is guaranteed.

In plain English

This is an automated trading bot that connects to Binance, a cryptocurrency exchange, and places buy and sell orders on your behalf. The author describes it as a personal test project and warns explicitly that there is no guarantee of profit and no responsibility taken for any losses. That disclaimer is front and center in the README. The core strategy is called trailing grid trading. Instead of buying or selling at a fixed target price, the bot follows the price as it moves. When a coin's price is falling, the bot keeps adjusting its buy order downward to chase the lowest point. Once the price turns back up past a set threshold, the order executes. The same logic applies when selling: the order chases the price upward and triggers when the price dips back down. This approach tries to buy closer to the bottom and sell closer to the top than a fixed-price order would. Grid trading adds another layer: you can set multiple buy rounds at different price levels. For example, buy 50 dollars worth if the price drops to a certain point, then buy 100 dollars more if it drops another 20 percent. The bot averages the purchase prices together and tracks a single last-buy-price figure to decide when selling becomes profitable. Multiple sell rounds work similarly, letting you cash out portions of your holdings at different price targets. The bot monitors multiple coins at the same time, checking prices every second. It uses a database called MongoDB to remember buy prices and settings across restarts. It runs inside Docker, which is a container system that packages all the software it needs, and the README notes it has been tested on Linux and Raspberry Pi 4. There is also integration with TradingView for technical analysis signals. The README is detailed with worked numeric examples for both buying and selling scenarios. Additional configuration documentation lives in the project wiki on GitHub.

Copy-paste prompts

Prompt 1
How do I configure the Binance trading bot to monitor three specific coins with different buy thresholds for each one?
Prompt 2
I want to set up three grid buy rounds: $50 at the first dip, $100 if the price drops another 10%, and $200 if it drops another 20%. Show me the config for multi-round grid buying.
Prompt 3
How do I run this trading bot using Docker on a Raspberry Pi 4, and where do I put my Binance API key?
Prompt 4
Show me how to connect the bot to a TradingView webhook signal so it only places buy orders when a specific indicator triggers.
Open on GitHub → Explain another repo

← chrisleekr on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.