squidKid-deluxe/QTradeX-Algo-Trading-SDK
关于
AI-powered SDK featuring algorithmic trading, backtesting, deployment on 100+ exchanges, and multiple optimization engines.
商业与金融可以做什么
- Bot Development: Extend BaseBot to craft custom strategies
- Backtesting: Easy-to-navigate CLI & live-coding based testing platform (Just select Autobacktest)
- Optimization: Use QPSO, LSGA, or others to fine-tune parameters
- Indicators: Wrapped Tulip indicators for blazing performance
实测星标增长
- 24小时
- 正在收集历史
- 7天
- 正在收集历史
- 15天
- 正在收集历史
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文🚀 QTradeX Core — Build, Backtest & Optimize AI-Powered Crypto Trading Bots
📸 See screenshots.md for more visuals
📚 Read the docs at qtradex.litepresence.com/docs
🤖 Explore community bots at QTradeX AI Agents DeepWiki
💬 Join our Telegram Group for discussion & support
TL;DR
QTradeX is a lightning-fast Python framework for designing, backtesting, and deploying algorithmic trading bots, built for crypto markets with support for 100+ exchanges, AI-driven optimization, and blazing-fast vectorized execution.
Like what we're doing? Give us a ⭐!
Why QTradeX?
Whether you're exploring a simple EMA crossover or engineering a strategy with 20+ indicators and genetic optimization, QTradeX gives you:
- Modular, non-locked architecture - want to use QTradeX's data fetching with a custom backtest engine? Go for it!
- Tulip + CCXT Integration
- Custom Bot Classes
- Fast, Disk-Cached Market Data
- Ultra Fast Backtests (even on a Raspberry Pi!)
🔍 Features at a Glance
- Bot Development: Extend
BaseBotto craft custom strategies - Backtesting: Easy-to-navigate CLI & live-coding based testing platform (Just select
Autobacktest) - Optimization: Use QPSO, LSGA, or others to fine-tune parameters
- Indicators: Wrapped Tulip indicators for blazing performance
- Data Sources: Pull candles from 100+ CEXs/DEXs with CCXT
- Performance Metrics: Evaluate bots with ROI, Sortino, Win Rate, and dozens more
- Speed: 200+ backtests per second for 3 years of daily candles on a Ryzen 5600x
Project Structure
qtradex/
├── core/ # Bot logic and backtesting
├── indicators/ # Technical indicators
├── optimizers/ # QPSO, LSGA, other optimizers, and common utilities
├── plot/ # Trade/metric visualization
├── private/ # Execution & paper wallets
├── public/ # Data feeds and utils
└── common/ # JSON RPC, BitShares nodes, and data caching
Quickstart
Install
pip install qtradex
Or, if you want the latest updates:
git clone https://github.com/squidKid-deluxe/QTradeX-Algo-Trading-SDK.git QTradeX
cd QTradeX
pip install -e .
Example Bot: EMA Crossover
import qtradex as qx
import numpy as np
class EMACrossBot(qx.BaseBot):
def __init__(self):
# Notes:
# - If you make the tune values integers, the optimizers
# will quantize them to the nearest integer.
# - By putting `_period` at the end of a tune value,
# QTradeX core will assume they are periods in days and will scale them
# to different candle sizes if the data given isn't daily
self.tune = {
"fast_ema_period": 10.0,
"slow_ema_period": 50.0
}
self.clamps = {
"fast_ema_period": [5, 10, 50, 1],
"slow_ema_period": [20, 50, 100, 1],
}
def indicators(self, data):
return {
"fast_ema": qx.ti.ema(data["close"], self.tune["fast_ema"]),
"slow_ema": qx.ti.ema(data["close"], self.tune["slow_ema"]),
}
def strategy(self, tick_info, indicators):
fast = indicators["fast_ema"]
slow = indicators["slow_ema"]
if fast > slow:
return qx.Buy()
elif fast < slow:
return qx.Sell()
return qx.Thresholds(buying=fast * 0.8, selling=fast * 1.2)
def plot(self, *args):
qx.plot(
self.info,
*args,
(
# key name label color axis idx axis name
("fast_ema", "EMA 1", "white", 0, "EMA Cross"),
("slow_ema", "EMA 2", "cyan", 0, "EMA Cross"),
)
)
# Load data and run
data = qx.Data(
exchange="kucoin",
asset="BTC",
currency="USDT",
begin="2020-01-01",
end="2023-01-01"
)
bot = EMACrossBot()
qx.dispatch(bot, data)
See more bots in QTradeX AI Agents
On-chain DEX data
Backtest against on-chain DEX pools with DexPaprika (30+ chains, no API key needed to start). Set exchange="dexpaprika" and pass the pool as network/address:
data = qx.Data(
exchange="dexpaprika",
asset="WETH",
currency="USDC",
pool="ethereum/0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640",
begin="2026-01-01",
end="2026-07-01",
)
Find pool addresses via https://api.dexpaprika.com/networks/{network}/pools/search.
Usage Guide
| Step | What to Do |
|---|---|
| 1️⃣ | Build a bot with custom logic by subclassing BaseBot |
| 2️⃣ | Backtest using qx.dispatch + historical data |
| 3️⃣ | Optimize with any algorithm you like (optimized tunes stored per-bot in tunes/) |
| 4️⃣ | Deploy live |
Roadmap
- More indicators (non-Tulip sources)
- GPU Acceleration for indicators
- Improved multi-core support for optimization
- Windows/Mac support
- TradFi Connectors: Stocks, Forex, and Comex support
Want to help out? Check out the Issues list for forseeable improvements and bugs.
Resources
📜 License
WTFPL — Do what you want. Just be awesome about it 😎
⭐ Star History
✨ Ready to start? Clone the repo, run your first bot, and tune away. Once tuned - LET THE EXECUTIONS BEGIN!
探索相关项目
加载中…