Trading Frameworks, support backtesting and live trading
Disclaimer: The founding contributor of pytrade.org is also the creator of
pfund
.
lean
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
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
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
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
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
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
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
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
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
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
About
Superalgos is a community-owned open-source project with a decentralized and token-incentivized Social Trading Network crowdsourcing superpowers for retail traders.
qstrader
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
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
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.