gitwtfhub

wtf is pyalgotrade?

gbeced/pyalgotrade — explained in plain English

Analysis updated 2026-06-26

4,654PythonAudience · dataComplexity · 3/5LicenseSetup · easy

TL;DR

PyAlgoTrade is a deprecated Python library for backtesting and running automated trading strategies using technical indicators, the author now recommends their newer project Basana instead.

Mindmap

mindmap
  root((pyalgotrade))
    What it does
      Backtest strategies
      Paper trading
      Live trading Bitcoin
    Tech stack
      Python
      TA-Lib
      pip
    Data sources
      Yahoo Finance CSV
      Google Finance CSV
      Quandl
      NinjaTrader
    Indicators
      Moving averages
      RSI
      Bollinger Bands
    Performance metrics
      Sharpe ratio
      Drawdown analysis

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Backtest a moving average crossover strategy against historical Yahoo Finance CSV data to see how it would have performed.

REASON 2

Calculate RSI and Bollinger Bands on historical price data to validate a trading signal before going live.

REASON 3

Run a paper trading simulation against real Bitcoin prices on Bitstamp without risking real money.

REASON 4

Measure a strategy's Sharpe ratio and maximum drawdown to compare risk-adjusted performance across multiple approaches.

What's in the stack?

PythonTA-Libpip

How it stacks up

gbeced/pyalgotradestrawberry-graphql/strawberryhunvreus/devpush
Stars4,6544,6534,652
LanguagePythonPythonPython
Setup difficultyeasyeasyhard
Complexity3/52/54/5
Audiencedatadeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 30min

Deprecated, Python 2.7/3.7 only, for new projects use Basana by the same author instead.

Apache 2.0, use freely for any purpose including commercial projects, keep the copyright notice.

Wtf does this do

PyAlgoTrade is a Python library for algorithmic trading, meaning code that automatically makes trading decisions based on rules you define. The README prominently notes that this project is deprecated and no longer maintained, and points readers to a newer project called Basana by the same author. The library is built around an event-driven model, where your trading strategy responds to price changes and other market events as they arrive rather than processing data in batches. The original focus was on backtesting, which means running a strategy against historical market data to see how it would have performed in the past. The library also supports paper trading (simulated trading with real market prices but no real money) and live trading, both of which are limited to Bitcoin on the Bitstamp exchange. For analyzing price data, PyAlgoTrade includes a range of common technical indicators: Simple Moving Average, Exponential Moving Average, Relative Strength Index, Bollinger Bands, and others. It can read historical price data from CSV files in formats produced by Yahoo Finance, Google Finance, Quandl, and NinjaTrader. For measuring how well a strategy performs, it provides metrics such as the Sharpe ratio and drawdown analysis, which are standard ways traders evaluate risk and return. It also integrates with TA-Lib, a widely used technical analysis library, and included support for watching Twitter events in real time, which was a common source of market signals at the time the library was active. The library was tested with Python 2.7 and 3.7 and can be installed via pip. Given its deprecated status, new projects should look at Basana instead.

Yoink these prompts

Prompt 1
Using PyAlgoTrade, write a backtest strategy that buys when the 20-day SMA crosses above the 50-day SMA on Yahoo Finance CSV data.
Prompt 2
How do I calculate RSI and Bollinger Bands for a stock using PyAlgoTrade's built-in technical indicators?
Prompt 3
Show me how to load historical price data from a Quandl CSV file into PyAlgoTrade and run a backtest.
Prompt 4
How do I measure the Sharpe ratio and max drawdown of a PyAlgoTrade backtest result?

Frequently asked questions

wtf is pyalgotrade?

PyAlgoTrade is a deprecated Python library for backtesting and running automated trading strategies using technical indicators, the author now recommends their newer project Basana instead.

What language is pyalgotrade written in?

Mainly Python. The stack also includes Python, TA-Lib, pip.

What license does pyalgotrade use?

Apache 2.0, use freely for any purpose including commercial projects, keep the copyright notice.

How hard is pyalgotrade to set up?

Setup difficulty is rated easy, with roughly 30min to a first successful run.

Who is pyalgotrade for?

Mainly data.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.