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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

qtradex-1.2.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

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

qtradex-1.2.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

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

qtradex-1.2.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

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

qtradex-1.2.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 MB view details)

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

qtradex-1.2.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.5 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.2.0-cp313-cp313-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.2.0-cp313-cp313-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0daad50f3756a587ede03c607086fde4d3369db711e19e2839b68cf26504343e
MD5 5e32f4c19700ed08e872d56599e1bac1
BLAKE2b-256 401bfb97f5580276414be8cb06bf11030a2f1a556c6b426b394a94437c980fc8

See more details on using hashes here.

Provenance

The following attestation bundles were made for qtradex-1.2.0-cp313-cp313-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.

File details

Details for the file qtradex-1.2.0-cp312-cp312-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.2.0-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 837d48eed96ff2e2ba3074a4a48ef0aa91c2fce844ff844f985dabe8d76548ff
MD5 a63bd49f8900a1afd949c04e5c84edaa
BLAKE2b-256 46f44f80610e13d18a16c8d34266dc2de0e21dfddf59fb3164bd0cc107b1ae96

See more details on using hashes here.

Provenance

The following attestation bundles were made for qtradex-1.2.0-cp312-cp312-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.

File details

Details for the file qtradex-1.2.0-cp311-cp311-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.2.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b347e6c5576f533787ca49746b880045c4af6b197b6b0ee396307420f838632d
MD5 1ef61af9cb02d4e48c4fc700a2ab66d1
BLAKE2b-256 3b5e0367de47cc63617d3a2ce3de20ac0f9459ff10cb311fe23120a7f7ef276b

See more details on using hashes here.

Provenance

The following attestation bundles were made for qtradex-1.2.0-cp311-cp311-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.

File details

Details for the file qtradex-1.2.0-cp310-cp310-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.2.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cb2a8a8b58c7c6dd0833d44394519e0547b8900721b676d02cef1509f32575ec
MD5 4ea8e74858adfe2963b4ff4701c5719d
BLAKE2b-256 ab7352eeaf886ca908b4fb022296af1c0625f6034003ad9c87443f5587122bab

See more details on using hashes here.

Provenance

The following attestation bundles were made for qtradex-1.2.0-cp310-cp310-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.

File details

Details for the file qtradex-1.2.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.2.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2872a418dd447ea105762948559f7edc35530f465086dd05322be66d2bc0685d
MD5 348777a77312f95b2aa37c50090f812b
BLAKE2b-256 9f84ce97cb5ddbb4382f6bf69d891a15c5ba786d00e1c0c2c802ee75af620e8e

See more details on using hashes here.

Provenance

The following attestation bundles were made for qtradex-1.2.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