u/Competitive-Fee-606

open source python frameworks for backtesting/execution
▲ 2 r/Daytrading+1 crossposts

open source python frameworks for backtesting/execution

Is anyone using their own code in preference to commercial/free trading platforms? I've been building tradedesk, a Python framework that lets you write strategies and run them unchanged in both backtest and live environments.

The core idea: strategies react to events (candle closes, fills, position updates), not to broker-specific APIs. Swapping from a backtest to live trading means changing a config value, not your strategy code.

It includes:

  • Event-driven architecture: market data → strategy → execution → portfolio → recording
  • Dukascopy tick data downloader + resampler (separate package: tradedesk-dukascopy)
  • Live trading integration (IG only for now) with retry/resilience handling. Other brokers can be added by coding to the same interface
  • ATR-based position sizing, spread gate, and risk management hooks
  • Trade recording, equity curve, and metrics pipeline
  • Portfolio and risk management
  • Recording and reporting

I'm building the open source tools alongside my own strategies (those aren't open source) so I use them every day and keep as much code as possible in the public libs rather than the private repos. They have a very high level of test coverage and docs.

Both packages are on PyPI:

pip install tradedesk tradedesk-dukascopy

GitHub: https://github.com/radiusred/tradedesk

I'd be interested to hear what tools and frameworks others are using if you're taking this approach to trading.

u/Competitive-Fee-606 — 13 days ago