gitwtfhub

wtf is pyalgotrade?

hezebang/pyalgotrade — explained in plain English

Analysis updated 2026-08-12 · repo last pushed 2023-11-13

Audience · developerComplexity · 3/5DormantLicenseSetup · moderate

TL;DR

A free Python toolkit for testing and running automated stock and crypto trading strategies. You write trading rules in code and replay historical market data to see how they would have performed before risking real money.

Mindmap

mindmap
  root((repo))
    What it does
      Backtesting
      Paper trading
      Live Bitcoin trading
    Inputs
      CSV market data
      Yahoo Finance files
      Google Finance files
    Use cases
      Test strategy ideas
      Learn algo trading
      Measure performance
    Tech stack
      Python 2.7 and 3.7
      Bitstamp exchange
      RSI and moving averages
    Audience
      Individual traders
      Finance students
      Hobbyists

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 and RSI strategy against years of historical stock data to see if it would have been profitable.

REASON 2

Run simulated paper trades using live market data to practice trading without risking real capital.

REASON 3

Trade Bitcoin automatically on the Bitstamp exchange using a custom coded strategy.

REASON 4

Learn how algorithmic trading systems process market events and evaluate buy or sell decisions.

What's in the stack?

PythonBitstamp APIYahoo Finance CSV

How it stacks up

hezebang/pyalgotrade000madz000/rfid-attendance00kaku/gallery-slider-block
LanguageTypeScriptJavaScript
Last pushed2023-11-132024-07-222021-05-19
MaintenanceDormantDormantDormant
Setup difficultymoderateeasyeasy
Complexity3/52/52/5
Audiencedeveloperdevelopergeneral

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

How do you spin it up?

Difficulty · moderate Time to first run · 30min

Requires an older Python version (2.7 or 3.7) and the project is deprecated with no maintenance, so dependency issues are likely on modern systems.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

Wtf does this do

PyAlgoTrade is a free Python toolkit that helps you test and run automated trading strategies. Instead of manually buying and selling stocks or cryptocurrencies, you write code that defines your trading rules, and the software applies them to market data on your behalf. The most common use is "backtesting", replaying historical market data through your strategy to see how it would have performed before you risk any real money. The project works by processing market events in sequence: each new price tick or data point triggers your code to evaluate whether to buy, sell, or hold. You can feed it historical price data from common CSV files like those from Yahoo Finance or Google Finance. Beyond simulated backtesting, it also supports "paper trading" (simulated trades using live market data) and actual live trading of Bitcoin through the Bitstamp exchange. The target users are individual algorithmic traders, finance students, or hobbyists who want to experiment with automated trading strategies using Python. For example, if you believed a certain combination of moving averages and the RSI indicator could predict stock movements, you could encode that logic, test it against years of historical data, and measure the results using built-in performance metrics like the Sharpe ratio. A major caveat: the project is officially deprecated and no longer maintained. The developers recommend looking at an alternative project called Basana for new work. PyAlgoTrade also relies on older versions of Python (2.7 and 3.7), so its real-world viability for modern live trading is limited. It is best treated as a learning resource for understanding how algorithmic trading systems work rather than a production-ready tool for managing live capital today.

Yoink these prompts

Prompt 1
Using the PyAlgoTrade Python library, write a backtesting strategy that buys when the 50-day moving average crosses above the 200-day moving average and sells when it crosses below, feeding it historical stock data from a Yahoo Finance CSV file.
Prompt 2
Create a PyAlgoTrade script that uses the RSI indicator to generate buy signals when RSI drops below 30 and sell signals when RSI exceeds 70, then reports the Sharpe ratio of the strategy.
Prompt 3
Write a PyAlgoTrade paper trading script that connects to live market data and simulates trades for a strategy based on two moving averages, printing each buy and sell decision as it happens.
Prompt 4
Build a PyAlgoTrade Bitcoin trading bot for the Bitstamp exchange that executes a simple momentum strategy whenever the price moves more than 5 percent in an hour.

Frequently asked questions

wtf is pyalgotrade?

A free Python toolkit for testing and running automated stock and crypto trading strategies. You write trading rules in code and replay historical market data to see how they would have performed before risking real money.

Is pyalgotrade actively maintained?

Dormant — no commits in 2+ years (last push 2023-11-13).

What license does pyalgotrade use?

Use freely for any purpose, including commercial use, as long as you keep the copyright notice.

How hard is pyalgotrade to set up?

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

Who is pyalgotrade for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

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