πΈ See screenshots.md for more visuals
π Read the core docs on QTradeX SDK DeepWiki
π€ Explore the bots at QTradeX AI Agents DeepWiki
π¬ Join our Telegram Group for discussion & support
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 β!
Whether you're exploring a simple EMA crossover or engineering a strategy with 20+ indicators and genetic optimization, QTradeX gives you:
β
Modular Architecture
β
Tulip + CCXT Integration
β
Custom Bot Classes
β
Fast, Disk-Cached Market Data
β
Near-Instant Backtests (even on Raspberry Pi!)
- π§ Bot Development: Extend
BaseBot
to craft custom strategies - π Backtesting: Plug-and-play CLI & code-based testing
- 𧬠Optimization: Use QPSO or LSGA 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
- π€ Speed: Up to 50+ backtests/sec on low-end hardware
qtradex/ βββ core/ # Bot logic and backtesting βββ indicators/ # Technical indicators βββ optimizers/ # QPSO and LSGA βββ plot/ # Trade/metric visualization βββ private/ # Execution & paper wallets βββ public/ # Data feeds and utils βββ common/ # JSON RPC, BitShares nodes βββ setup.py # Install script
git clone https://github.com/squidKid-deluxe/QTradeX-Algo-Trading-SDK.git QTradeX cd QTradeX pip install -e .
import qtradex as qx import numpy as np class EMACrossBot(qx.BaseBot): def __init__(self): self.tune = {"fast_ema": 10, "slow_ema": 50} 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=0.5 * fast, selling=2 * fast) 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
Step | What to Do |
---|---|
1οΈβ£ | Build a bot with custom logic by subclassing BaseBot |
2οΈβ£ | Backtest using qx.core.dispatch + historical data |
3οΈβ£ | Optimize with qpso.py or lsga.py (tunes stored in /tunes ) |
4οΈβ£ | Deploy live |
- π More indicators (non-Tulip sources)
- π¦ TradFi Connectors: Stocks, Forex, and Comex support
Want to help out? Check out the Issues list for forseeable improvements and bugs.
- π§ QTradeX Algo Trading Strategies
- π Tulipy Docs
- π CCXT Docs
WTFPL β Do what you want. Just be awesome about it π
β¨ Ready to start? Clone the repo, run your first bot, and tune away. Once tuned - LET THE EXECUTIONS BEGIN!