Skip to main content

AI-powered SDK featuring algorithmic trading, backtesting, deployment on 100+ exchanges, and multiple optimization engines.

Project description

๐Ÿš€ QTradeX Core โ€” Build, Backtest & Optimize AI-Powered Crypto Trading Bots

QTradeX Demo Screenshot

๐Ÿ“ธ 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


โšก๏ธ 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 Architecture
โœ… Tulip + CCXT Integration
โœ… Custom Bot Classes
โœ… Fast, Disk-Cached Market Data
โœ… Near-Instant Backtests (even on Raspberry Pi!)


๐Ÿ” Features at a Glance

  • ๐Ÿง  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

โš™๏ธ Project Structure


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


๐Ÿš€ Quickstart

Install

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):
        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


๐Ÿšฆ Usage Guide

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

๐Ÿงญ Roadmap

  • ๐Ÿ“ˆ 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.


๐Ÿ“š Resources


๐Ÿ“œ License

WTFPL โ€” Do what you want. Just be awesome about it ๐Ÿ˜Ž


โญ Star History

Star History Chart

โœจ Ready to start? Clone the repo, run your first bot, and tune away. Once tuned - LET THE EXECUTIONS BEGIN!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qtradex-1.1.0.tar.gz (257.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qtradex-1.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64manylinux: glibc 2.5+ x86-64

File details

Details for the file qtradex-1.1.0.tar.gz.

File metadata

  • Download URL: qtradex-1.1.0.tar.gz
  • Upload date:
  • Size: 257.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for qtradex-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4bd55e900a101d1d3759c0e2180ae0cdd0ccbcc0bd430ba91be33cd8e95da3e7
MD5 5ead8a8e99f285d175f857deb29cfab2
BLAKE2b-256 e61fd40151ef28a756331c782a87b1c62aa6e31ee6624cefe513ea0c69061607

See more details on using hashes here.

Provenance

The following attestation bundles were made for qtradex-1.1.0.tar.gz:

Publisher: publish.yml on squidKid-deluxe/QTradeX-Algo-Trading-SDK

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qtradex-1.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for qtradex-1.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2485e0b804d9112cf9326f01e7ae611e6d085e604a1a66d903431658b47286cd
MD5 d96d8d1a23ca9374300ab3e8eb305ddb
BLAKE2b-256 60ff54d340318fded1cef626c9e8643b42199b33f84c0230940613c139bab48c

See more details on using hashes here.

Provenance

The following attestation bundles were made for qtradex-1.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish.yml on squidKid-deluxe/QTradeX-Algo-Trading-SDK

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page