Hi everyone, I’m shousake. This article brings you to a brand new topic: quantitative trading bots. I’m going to introduce Hummingbot, an open-source, free quantitative trading project. You simply need to store your exchange’s API key to run it. Isn’t it great? Compared to closed-source and high-cost platforms, Hummingbot offers a reliable solution, supporting multiple exchanges and strategies. Let’s take a closer look at Hummingbot.

1. What is Hummingbot?
- Hummingbot is an Apache-2.0 licensed, open‑source framework written in Python and C++, designed to automate market-making, arbitrage, and other trading strategies on centralized and decentralized exchanges
- It supports over 140 trading venues and has processed tens of billions in trading volume GitHub.
- Your API keys and strategy logic run locally (not in the cloud)—so you retain full control of your secrets and execution. Hummingbot encrypts your keys with a local password; nothing passes through Hummingbot servers
2. Install via Docker (Quickest Method)
Running with Docker avoids messing with Python environments and let’s you safely use the release version even without modifying the code.

Prerequisites
- A machine with Docker Engine + Docker Compose installed
- At least 4 GB RAM, 5 GB free disk space
- Works on Linux (Ubuntu/Debian), macOS, or Windows (WSL2/Docker Desktop)
Step-by-step Setup

# 1) Clone the official repo
git clone https://github.com/hummingbot/hummingbot.git
cd hummingbot
# 2) Build and start the Docker composition
docker compose up -d
Wait a minute for Docker to pull the latest Hummingbot image and spin up the containers
Attach to the CLI client:
docker attach hummingbot

On first run, Hummingbot will prompt you to create a password—to encrypt your API credentials locally. Don’t lose it!


3. Connecting to Exchanges (Spot & Perpetual)
Let’s connect Hummingbot to Exchanges—spot and perpetual are both supported in v2 connector version 2.1+
a) Create API Keys on Bybit
Let’s use Bybit as an example.
- Log in to your Bybit account.
- Go to API Management, generate a new key.
- Only enable “Trade” or “Transaction” rights—do not enable withdrawal.
- Copy the API Key and Secret, store them securely.





b) Add Keys into Hummingbot
Inside the Docker CLI:
connect bybit
# Insert your spot API Key and Secret
# For perpetual markets:
connect bybit_perpetual
# Optional: anti-MMR or Hedge mode depending on your Bybit account structure
You can confirm by running:
status
balance

4. Running Your First Strategy: Directional RSI
Hummingbot ships with example script strategies built on the new V2 strategy framework: v2_directional_rsi.py is a particularly beginner-friendly one.
What it does:
- Uses the RSI indicator: looks for oversold (RSI low bound) to go long or overbought (RSI high bound) to go short
- After a trade, it uses a “triple-barrier” PositionExecutor to automatically manage stop‑loss and take‑profit targets and exit on time or profit/loss thresholds .
I. Create Config
create --script-config v2_directional_rsi
You’ll be prompted to set:
- exchange (
bybit
orbybit_perpetual
) - market pair (e.g.
BTC-USDT
) - direction (long/short/auto)
- RSI thresholds (e.g. low=30, high=70)
- stop-loss / take‑profit levels
You can accept defaults or customize. At the end, it will ask for a filename like conf_rsi_btc_usdt.yml
.
II. Start the Bot
start --script v2_directional_rsi.py --conf conf_rsi_btc_usdt.yml
Once launched, you’ll see frequent logs like:
[2025-08-04 03:14:07] {Log} Signal generated: LONG, price=29317.5
[2025-08-04 03:14:08] {OrderManager} Entered trade (size=0.001 BTC @ 29317.5 USDT)...
# It continues to show exits based on TP/SL or barrier timeout

III. Monitor & Control
Try these commands inside:
status # bot health, current position
history # list of past trades
profit_and_loss # runs cumulative P&L
stop # to safely stop the script
quit # exits Hummingbot CLI
希望出更多的详细教程,其他视频都是英文的,头大
希望出更多的详细教程
没问题
为什么其他的视频都是几年前的?最近hummingbot不火了吗?大家都去TV和MT了吗!
不知道,我最早接触也是年初了,当时也不火,但是我觉得挺有意思就来讲讲,正好当时我也用过