Trading Frameworks

Trading Frameworks, support backtesting and live trading

Disclaimer: The founding contributor of pytrade.org is also the creator of pfund.

RepoSiteStarsIssuesContributorsVersionLast PublishForksWatchers
Lean (opens in a new tab) (opens in a new tab)985025530R-Support, Visual Studio Integration, Python Updates2017-08-083263426
nautilus_trader (opens in a new tab) (opens in a new tab)21445530NautilusTrader 1.205.0 Beta2024-11-0348266
backtrader (opens in a new tab) (opens in a new tab)1463854303937613
pfund (opens in a new tab) (opens in a new tab)220131
trading-strategy (opens in a new tab) (opens in a new tab)23199424
blankly (opens in a new tab) (opens in a new tab)21282917v1.18.0-beta2022-06-1526843
vnpy (opens in a new tab) (opens in a new tab)2572212303.9.32024-10-1088141355
freqtrade (opens in a new tab) (opens in a new tab)2875655302024.102024-10-316159640
hummingbot (opens in a new tab) (opens in a new tab)823637930v2.1.02024-10-282830153
jesse (opens in a new tab) (opens in a new tab)5675730729182
Superalgos (opens in a new tab) (opens in a new tab)42136630Superalgos-Beta-v1.7.0 Snapshot 202411082024-11-085548222
qstrader (opens in a new tab) (opens in a new tab)29411214v0.3.02024-06-24855267
qtpylib (opens in a new tab) (opens in a new tab)2156696513142
zipline-reloaded (opens in a new tab) (opens in a new tab)117814303.12024-09-2621640

lean

PyPIPyPI downloadsPyPI - Support Python Versions
About

LEAN is an event-driven, professional-caliber algorithmic trading platform built with a passion for elegant engineering and deep quant concept modeling. Out-of-the-box alternative data and live-trading support. Written in C# with Python integration.

Core Features
  • Survivorship-Bias-Free Data: Automated accounting for splits, dividends, and corporate actions
  • Universe Selection: Avoid selection bias with algorithmically selected assets. Create and select asset universes based on proprietary data and indicators.
  • Portfolio Management: Automatically track portfolio performance, profit and loss, buying power, and holdings across multiple asset classes and margin models in the same strategy
  • Scheduled Events: Trigger regular functions to occur at desired times during market hours, on certain days of the week, or at specific times of the day
  • Import Custom Data: Backtest on almost any time series and import your proprietary signal data into your strategy
  • Powerful Modeling: Everything is configurable and pluggable. LEAN’s highly modular foundation can easily be extended for your fund needs

nautilus_trader

PyPIPyPI downloadsPyPI - Support Python Versions
A high-performance algorithmic trading platform and event-driven backtester
About

NautilusTrader is an open-source, high-performance, production-grade algorithmic trading platform, providing quantitative traders with the ability to backtest portfolios of automated trading strategies on historical data with an event-driven engine, and also deploy those same strategies live, with no code changes.

Core Features
  • Core is written in Rust with asynchronous networking using tokio.
  • Type safety and thread safety through Rust. Redis-backed performant state persistence.
  • OS independent, runs on Linux, macOS, and Windows. Deploy using Docker.
  • Add user-defined custom components, or assemble entire systems from scratch leveraging the cache and message bus.
  • Run with multiple venues, instruments and strategies simultaneously using historical quote tick, trade tick, bar, order book and custom data with nanosecond resolution.
  • Use identical strategy implementations between backtesting and live deployments.

backtrader

PyPIPyPI downloadsPyPI - Support Python Versions
Python Backtesting library for trading strategies
About

Backtrader is a feature-rich Python framework for backtesting and trading. It allows you to focus on writing reusable trading strategies, indicators and analyzers instead of having to spend time building infrastructure.

Core Features
  • Live Data Feeds and Broker Integration: Supports Interactive Brokers, Oanda (REST API), and Visual Chart for live trading.
  • Multi-Asset & Strategy Support: Allows multiple data feeds, timeframes, and strategies to run simultaneously.
  • Technical Indicators: Offers a wide range of indicators, including TA-Lib support, and easy creation of custom indicators.
  • Performance Analysis: Includes built-in analyzers (Sharpe ratio, SQN, etc.) and pyfolio integration (deprecated).
  • Commission & Order Management: Flexible commission schemes, broker simulation, support for advanced orders (OCO, bracket orders), and automated staking with sizers.
  • Trading Utilities: Features like cheat-on-open/close modes, trading calendars, schedulers, and matplotlib-based plotting.

pfund

PyPIPyPI downloadsPyPI - Support Python Versions
An All-in-One Algo-Trading Framework: Backtest -> Train -> Trade -> Monitor. Machine / Deep Learning Ready. Supports All Trading: TradFi+CeFi+DeFi. Code Once, Trade Anywhere.
About

PFund is a complete algo-trading Framework powered by machine Learning and data Engineering, TradFi, CeFi and DeFi ready. Code Once, Trade Anywhere.

Core Features
  • Vectorized Backtesting: Supports vectorized and event-driven backtesting with different resolutions of data, e.g. tick data, second data and minute data etc.
  • Flexible Data Integration: Allows choosing your preferred data tool, e.g. pandas, polars, pyspark etc.
  • Machine Learning Integration: Supports machine learning models, features, technical analysis indicators. Trains machine learning models using your favorite frameworks, i.e. PFund is ML-framework agnostic
  • Modular Strategy Building: Offers LEGO-style strategy and model building, allowing strategies to add other strategies, models to add other models
  • Streamlined Workflow: Streamlines the algo-trading flow, from vectorized backtesting for strategy prototyping and event-driven backtesting for strategy development, to live trading for strategy deployment
  • Parallel Data Processing: Enables parallel data processing, e.g. Interactive Brokers and Binance each have their own process for receiving data feeds
  • Trading Pipeline: Switches from backtesting to live trading by just changing ONE line of code

trading-strategy

PyPIPyPI downloadsPyPI - Support Python Versions
Python framework for quantitative financial analysis and trading algorithms on decentralised exchanges
About

Trading Strategy is a Python framework for quantitative financial analysis and trading algorithms on decentralized exchanges.

Core Features
  • Supports multiple blockchains like Ethereum mainnet, Binance Smart Chain and Polygon
  • Access trading data from on-chain decentralized exchanges like SushiSwap, QuickSwap and PancakeSwap
  • Integration with Jupyter Notebook for easy manipulation of data. See example notebooks.
  • Write algorithmic trading strategies for decentralized exchange

blankly

PyPIPyPI downloadsPyPI - Support Python Versions
🚀 💸 Easily build, backtest and deploy your algo in just a few lines of code. Trade stocks, cryptos, and forex across exchanges w/ one package.
About

Blankly is an ecosystem for algotraders enabling anyone to build, monetize and scale their trading algorithms for stocks, crypto, futures or forex. The same code can be backtested, paper traded, sandbox tested and run live by simply changing a single line.

Core Features
  • One Codebase, Cross-Exchange, Trading Multiple Entities
  • Optimized for Performance at Scale
  • Easy Integration with Existing Codebases
  • Built-In Backtesting with Portfolio Metrics
  • Production in One Line

vnpy

PyPIPyPI downloadsPyPI - Support Python Versions
基于Python的开源量化交易平台开发框架
About

Vnpy is a Python-based open source quantitative trading system development framework.

Core Features
  • Integrates a variety of trading interfaces and provides simple and easy-to-use APIs for specific strategy algorithm and function development
  • Trading interfaces covering all China domestic and international trading varieties
  • Out-of-the-box trading applications for various quantitative strategies
  • Python trading API interface package
  • Simple and easy-to-use event-driven engine
  • Standardized management client interfacing with various databases

freqtrade

PyPIPyPI downloadsPyPI - Support Python Versions
Free, open source crypto trading bot
About

Freqtrade is a free and open source crypto trading bot written in Python. It is designed to support all major exchanges and be controlled via Telegram or webUI. It contains backtesting, plotting and money management tools as well as strategy optimization by machine learning.

Core Features
  • Strategy Optimization by machine learning: Use machine learning to optimize your buy/sell strategy parameters with real exchange data.
  • Adaptive prediction modeling: Build a smart strategy with FreqAI that self-trains to the market via adaptive machine learning methods. Learn more
  • Edge position sizing Calculate your win rate, risk reward ratio, the best stoploss and adjust your position size before taking a position for each specific market. Learn more.
  • Builtin WebUI: Builtin web UI to manage your bot.
  • Manageable via Telegram: Manage the bot with Telegram.

hummingbot

PyPIPyPI downloadsPyPI - Support Python Versions
Open source software that helps you create and deploy high-frequency crypto trading bots
About

Hummingbot is an open source framework that helps you build automated trading strategies, or bots that run on cryptocurrency exchanges.

Core Features
  • Both CEX and DEX connectors: Hummingbot supports connectors to centralized exchanges like Binance and KuCoin, as well as decentralized exchanges like Uniswap and PancakeSwap on various blockchains (Ethereum, BNB Chain, etc).
  • Cutting edge strategy framework: Its new V2 Strategies framework allows you to compose powerful, backtestable, multi-venue, multi-timeframe strategies of any type
  • Secure local client: Hummingbot is a local client software that you install and run on your own devices or cloud virtual machines. It encrypts your API keys and private keys and never exposes them to any third parties.

jesse

PyPIPyPI downloadsPyPI - Support Python Versions
An advanced crypto trading bot written in Python
About

Jesse is an advanced crypto trading framework that aims to simplify researching and defining YOUR OWN trading strategies.

Core Features
  • Multiple Timeframes and Symbols: Backtest and livetrade multiple timeframes and symbols simultaneously without look-ahead bias
  • Risk Management: Built-in helper functions for robust risk management
  • Smart Ordering: Supports market, limit, and stop orders, automatically choosing the best one for you
  • Comprehensive Indicator Library: Access a complete library of technical indicators with easy-to-use syntax
  • Partial Fills: Supports entering and exiting positions in multiple orders, allowing for greater flexibility
  • Auto-Generated Charts: View your portfolio's performance with automatically generated charts

Superalgos

PyPIPyPI downloadsPyPI - Support Python Versions
Free, open-source crypto trading bot, automated bitcoin / cryptocurrency trading software, algorithmic trading bots. Visually design your crypto trading bot, leveraging an integrated charting system, data-mining, backtesting, paper trading, and multi-server crypto bot deployments.
About

Superalgos is a community-owned open-source project with a decentralized and token-incentivized Social Trading Network crowdsourcing superpowers for retail traders.

qstrader

PyPIPyPI downloadsPyPI - Support Python Versions
QuantStart.com - QSTrader backtesting simulation engine.
About

QSTrader is a free Python-based open-source modular schedule-driven backtesting framework for long-short equities and ETF based systematic trading strategies.

Core Features
  • Backtesting Engine: Employs a schedule-based portfolio construction approach to systematic trading.
  • Signal generation is decoupled from portfolio construction, risk management, execution and simulated brokerage accounting in a modular, object-oriented fashion.
  • Performance Statistics: Provides typical 'tearsheet' performance assessment of strategies. It also supports statistics export via JSON to allow external software to consume metrics from backtests.

qtpylib

PyPIPyPI downloadsPyPI - Support Python Versions
QTPyLib, Pythonic Algorithmic Trading
About

QTPyLib (Quantitative Trading Python Library) is a simple, event-driven algorithmic trading library written in Python, that supports backtesting, as well as paper and live trading via Interactive Brokers.

Core Features
  • A continuously-running Blotter that lets you capture market data even when your algos aren't running.
  • Tick, Bar and Trade data is stored in MySQL for later analysis and backtesting.
  • Using pub/sub architecture using ØMQ (ZeroMQ) for communicating between the Algo and the Blotter allows for a single Blotter/multiple Algos running on the same machine.
  • Market data events use asynchronous, non-blocking architecture.
  • Have orders delivered to your mobile via SMS (requires a Nexmo or Twilio account).

zipline-reloaded

PyPIPyPI downloadsPyPI - Support Python Versions
Zipline, a Pythonic Algorithmic Trading Library
About

Zipline is a Pythonic event-driven system for backtesting, developed and used as the backtesting and live-trading engine by crowd-sourced investment fund Quantopian.

Core Features
  • Ease of Use: Zipline tries to get out of your way so that you can focus on algorithm development
  • Batteries Included: many common statistics like moving average and linear regression can be readily accessed from within a user-written algorithm.
  • PyData Integration: Input of historical data and output of performance statistics are based on Pandas DataFrames to integrate nicely into the existing PyData ecosystem.
  • Statistics and Machine Learning Libraries: You can use libraries like matplotlib, scipy, statsmodels, and scikit-klearn to support development, analysis, and visualization of state-of-the-art trading systems.