pybroker

Algorithmic Trading in Python with Machine Learning

What is pybroker?

Algorithmic Trading in Python with Machine Learning

Overview of pybroker

What it is

PyBroker is an open-source Python framework for developing algorithmic trading strategies, with a focus on strategies that use machine learning. It provides a backtesting engine built in NumPy and accelerated with Numba, and supports data from Alpaca, Yahoo Finance, AKShare, or custom data providers.

Key features

  • A super-fast backtesting engine built in NumPy and accelerated with Numba.
  • Easy creation of trading rules and models for executing across multiple instruments.
  • Integration of trading signals across multiple time intervals, including daily, weekly, and monthly.
  • Access to historical data from Alpaca, Yahoo Finance, AKShare, or from your own data provider.
  • Model training and backtesting using Walkforward Analysis, which simulates how the strategy would perform during actual trading.
  • Reliable trading metrics that use randomized bootstrapping to provide more accurate results.
  • Parameter optimization with Optuna to select the best strategy parameters.
  • Caching of downloaded data, indicators, and models to speed up your development process.
  • Parallelized computation and training for faster performance.
  • Agent Skills that help AI agents write trading strategies and backtests using PyBroker.

Use cases

PyBroker is designed for algorithmic trading strategy development, particularly those incorporating machine learning. It can be used for rule-based strategies (e.g., buying on a new 10-day high) and model-based strategies (e.g., training a model on indicators and using its predictions for buy/sell decisions). It supports Walkforward Analysis, parameter optimization, rotational trading, margin trading, and slippage modeling. It also includes AI agent skills for coding agents to create strategies, indicators, and model trainers.

Getting started

PyBroker supports Python 3.11+ on Windows, Mac, and Linux. Install using pip:bash pip install -U lib-pybrokerOr clone the Git repository:bash git clone https://github.com/edtechre/pybroker

License and pricing

The license is not stated in the provided metadata or README. The project is listed as open-source.

Based on the project's public README and repository metadata.

Add this badge to your README

Featured on YunoDB Badge styles & help

Maintain this project? Show that it is featured on YunoDB.

Markdown[![Featured on YunoDB](https://yunodb.com/badge/edtechrepybroker.svg)](https://yunodb.com/tools/edtechrepybroker?utm_source=github&utm_medium=badge)
HTML<a href="https://yunodb.com/tools/edtechrepybroker?utm_source=github&utm_medium=badge"><img src="https://yunodb.com/badge/edtechrepybroker.svg" alt="Featured on YunoDB" height="20"></a>