Trading infrastructure library with backtesting
Project description
tradedesk
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:
- Providers – Interfaces to external data/execution sources (e.g. IG, historical backtest data)
- Clients – Concrete implementations that fetch data and place orders
- Strategies – User-defined trading logic responding to market events
- 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:
- Construction
- Subscription registration
- Warmup (optional but strongly recommended)
- Live or replayed market data handling
- Order execution
- 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
- Install dependencies
- Write or select a strategy
- Choose a client (backtest or live)
- Run via the
tradedeskrunner
Detailed tutorials are provided in the documentation guides listed below.
Project status and guarantees
- APIs may evolve as the framework matures
- Backwards compatibility is maintained on a best-effort basis
- The framework prioritises correctness and clarity over performance
Further reading
docs/indicators.md– Indicator concepts and mathematical foundationsdocs/strategy_writing_guide.md– Step-by-step strategy tutorialdocs/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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tradedesk-0.1.0.tar.gz.
File metadata
- Download URL: tradedesk-0.1.0.tar.gz
- Upload date:
- Size: 74.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c224b31be28846ceb0f315f414c4810c569be155482005029898b956cf99ab81
|
|
| MD5 |
78f7f2fb583e7e9dbf907fea2b3a8c32
|
|
| BLAKE2b-256 |
7c0f23246fea92a406b0b159057396ad70f7b3206b603a32e7aea5b8b6ad336e
|
Provenance
The following attestation bundles were made for tradedesk-0.1.0.tar.gz:
Publisher:
publish.yml on radiusred/tradedesk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tradedesk-0.1.0.tar.gz -
Subject digest:
c224b31be28846ceb0f315f414c4810c569be155482005029898b956cf99ab81 - Sigstore transparency entry: 839777815
- Sigstore integration time:
-
Permalink:
radiusred/tradedesk@e5d4d95437de6700dcc2dc0f42d468f98b03cb6a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/radiusred
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e5d4d95437de6700dcc2dc0f42d468f98b03cb6a -
Trigger Event:
release
-
Statement type:
File details
Details for the file tradedesk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tradedesk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 48.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
708cb795ec5fa70e95d19548990423d60fc41d3d7d3fbb7d35d32406e787e1a6
|
|
| MD5 |
fa62aed13341efda8632538226c83861
|
|
| BLAKE2b-256 |
9cd0aa56b8959e27bc419fb5a00b8b6e2714beddbb209e17bda4b272a06e6b59
|
Provenance
The following attestation bundles were made for tradedesk-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on radiusred/tradedesk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
tradedesk-0.1.0-py3-none-any.whl -
Subject digest:
708cb795ec5fa70e95d19548990423d60fc41d3d7d3fbb7d35d32406e787e1a6 - Sigstore transparency entry: 839777852
- Sigstore integration time:
-
Permalink:
radiusred/tradedesk@e5d4d95437de6700dcc2dc0f42d468f98b03cb6a -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/radiusred
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@e5d4d95437de6700dcc2dc0f42d468f98b03cb6a -
Trigger Event:
release
-
Statement type: