Skip to content

QTradeX Docs

SDK commit reference

These docs correspond to SDK commit 7815d1e. Run git pull or pip install qtradex to ensure your SDK matches.

import qtradex as qx

class EMACrossBot(qx.BaseBot):
    def indicators(self, data):
        return {
            "fast_ema": qx.ti.ema(data["close"], 10),
            "slow_ema": qx.ti.ema(data["close"], 50),
        }
    def strategy(self, state, indicators):
        if indicators["fast_ema"] > indicators["slow_ema"]:
            return qx.Buy()
        elif indicators["fast_ema"] < indicators["slow_ema"]:
            return qx.Sell()
        return qx.Hold()

A bot class. Two indicators. A decision rule. That's the skeleton of every QTradeX strategy.

Get Started →


Explore


Community & Resources