PyBroker

PyBroker

โ˜… 3.8 ๐Ÿ”– 1200 saves ๐Ÿ’ฐ Free GitHub

PyBroker is a Python framework for developing algorithmic trading strategies, with a particular focus on strategies that use machine learning. It pairs a very fast backtesting engine โ€” built on NumPy and accelerated with Numba โ€” with tools to train models, run walkforward analysis and evaluate strategies with bootstrapped metrics that resist overfitting. The project has around 3,600 stars on GitHub and remains actively maintained.

Overview

A PyBroker strategy combines data sources, indicators and execution rules or trained models, and can trade multiple instruments in one run. Historical data can come from Alpaca, Yahoo Finance or AKShare, or from a custom provider you plug in. Models are registered with a training function and retrained automatically inside walkforward windows, simulating how the strategy would actually have performed live. Downloaded data, indicators and models are cached to disk, and computations are parallelised, so iterating on a strategy is fast. The framework also handles practical details such as position sizing, ranking, stops, rebalancing and rotational trading, and ships an extensive user guide with notebooks for every feature.

Key Features

  • Fast Numba-accelerated backtesting engine for rule- and model-based strategies
  • Walkforward analysis that retrains models as it moves through time
  • Bootstrapped performance metrics for more reliable evaluation
  • Data from Alpaca, Yahoo Finance, AKShare or custom providers
  • Built-in indicator library plus support for your own indicators
  • Caching and parallel computation for quick iteration
  • Detailed documentation and example notebooks

๐Ÿ’ณ Pricing

PyBroker is free to use: install it from PyPI or clone the GitHub repository. Market-data subscriptions from providers such as Alpaca are separate and priced by those providers.

Who Is It For

Quantitative traders, data scientists and Python developers who want to prototype and honestly evaluate machine-learning trading strategies for stocks and crypto before risking real capital.

๐Ÿš€ Visit PyBroker Official Site

๐Ÿšฉ Report an issue