Skip to main content

Trading infrastructure library with backtesting

Project description

tradedesk

CI Build PyPI Version

What tradedesk is

tradedesk is a lightweight Python framework for developing, backtesting, and running systematic trading strategies across multiple data providers and execution environments.

It provides:

  • A consistent strategy lifecycle
  • Explicit separation between market data, strategy logic, and execution
  • Deterministic backtesting with identical strategy code
  • Live and DEMO execution via provider-specific clients

It is designed for research, validation, and controlled deployment of trading strategies rather than high-frequency or ultra-low-latency trading.

What tradedesk is not

tradedesk is intentionally not:

  • A portfolio management system
  • A signal marketplace
  • A turnkey trading bot
  • A performance-optimised HFT engine

It REQUIRES the user to accept responsibility for strategy design, risk management, and operational controls.

High-level architecture

At a high level, tradedesk consists of four layers:

  1. Providers – Interfaces to external data/execution sources (e.g. IG, historical backtest data)
  2. Clients – Concrete implementations that fetch data and place orders
  3. Strategies – User-defined trading logic responding to market events
  4. Runner – Orchestrates lifecycle, subscriptions, warmup, and shutdown

Market data flows from the provider into the strategy, which emits execution decisions back through the client.

Core concepts

Strategy lifecycle

A strategy progresses through the following phases:

  1. Construction
  2. Subscription registration
  3. Warmup (optional but strongly recommended)
  4. Live or replayed market data handling
  5. Order execution
  6. Graceful shutdown

Subscriptions

Strategies explicitly declare their required data via subscriptions:

  • MarketSubscription – Tick-level price updates (bid/offer)
  • ChartSubscription – Aggregated candle data for a given timeframe

Only subscribed data is delivered to the strategy.

Warmup

Warmup allows a strategy to request historical data before live execution begins in order to initialise indicator state and internal windows.

A strategy that does not warm up must be robust to partially initialised indicators and delayed signal readiness.

Backtest vs live execution

The same strategy code can be run against:

  • A live or DEMO provider
  • A deterministic backtest client that replays historical data

Differences between environments are isolated to the client layer.

Supported providers

  • IG – Live and DEMO trading via REST and streaming APIs
  • BacktestClient – Deterministic replay of historical data

Historical data acquisition is handled by a companion project:

  • tradedesk-dukascopy

Quick start

  1. Install dependencies
  2. Write or select a strategy
  3. Choose a client (backtest or live)
  4. Run via the tradedesk runner

Detailed tutorials are provided in the documentation guides listed below.

Project status and guarantees

  • APIs are evolving as the framework matures
  • Prior to a 1.0 release, there is NO guarantee of backward compatibility between minor versions of the framework
  • The framework prioritises correctness and clarity over performance

Further reading

  • docs/indicators.md – Indicator concepts and mathematical foundations
  • docs/strategy_writing_guide.md – Step-by-step strategy tutorial
  • docs/backtesting_guide.md – Methodology for rigorous backtesting

License

Licensed under the Apache License, Version 2.0. See: https://www.apache.org/licenses/LICENSE-2.0

Copyright 2026 Radius Red Ltd.

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

tradedesk-0.3.0.tar.gz (103.8 kB view details)

Uploaded Source

Built Distribution

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

tradedesk-0.3.0-py3-none-any.whl (61.0 kB view details)

Uploaded Python 3

File details

Details for the file tradedesk-0.3.0.tar.gz.

File metadata

  • Download URL: tradedesk-0.3.0.tar.gz
  • Upload date:
  • Size: 103.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tradedesk-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6b832e437243fe22093893463299097c5d08c1c46b219be425dbca89800b5ff0
MD5 77f7084d63fd8c8c69a5c51ce495516e
BLAKE2b-256 b540da8e7033a9f42afc1b13c3919865b8e27c56ceb5b18184e004204f7b91ab

See more details on using hashes here.

Provenance

The following attestation bundles were made for tradedesk-0.3.0.tar.gz:

Publisher: publish.yml on radiusred/tradedesk

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

File details

Details for the file tradedesk-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: tradedesk-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 61.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for tradedesk-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c744a9245066d769560f467593612c20c77da33be5fd67471b99ea44e57ec8f4
MD5 259a78304c4d6f813811aa4782dc9647
BLAKE2b-256 f1aad42108946de226b1c7644f2f39feb9ffa9240e88eb83c63a9ef14ef95d22

See more details on using hashes here.

Provenance

The following attestation bundles were made for tradedesk-0.3.0-py3-none-any.whl:

Publisher: publish.yml on radiusred/tradedesk

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