Markets and trading · Edition No. 2 · 27 Aug 2026

kernc/backtesting.py

The lowest-friction Python backtester — 20 lines to a full trade log, equity curve and parameter sweep.

← Markets and tradingRead the whole edition →

8.9k stars · AGPL-3.0 · v0.6.6 on PyPI (2026-07)

The lowest-friction Python backtester — 20 lines to a full trade log, equity curve and parameter sweep.

Repo detailsthe review · specs · pros & cons · install

What it is

A small Python backtesting framework: define entry and exit rules as a class, hand it a dataframe of candles, and get back a full trade log, an equity curve, a drawdown profile and an interactive chart. Parameter sweeps and optimisation are built in.

Why it matters

Edition 1 gave you STUMPY to find repeating shapes in three years of EURUSD. Finding them is the easy half — almost all of them are noise, and the only way to tell which is to test them. This is the shortest path from "STUMPY found a motif" to "here is what it returned across three years, after spread." Your 2%-a-month target is a testable claim, and the value of this library is that testing is cheap enough that you will actually run twenty ideas instead of falling in love with the first one.

Stars8.9k
LicenceAGPL-3.0
Latestv0.6.6 on PyPI (2026-07)checked 7 Sep 2026
Written inPython
RunsLocally, on your own machine
Setup effort
2 / 5
Payoff
4 / 5
Good
  • The least ceremony of any Python backtester — a working test really is about twenty lines
  • Built-in optimiser and interactive charts showing exactly where each trade opened and closed
  • Heavily documented with a large body of public examples for Claude Code to draw on
Watch for
  • AGPL-3.0. Fine for your own research, a genuine problem if backtesting becomes a feature customers use inside ScalpingMate — check this before you build on it
  • Single asset, single timeframe by design. It will not model a portfolio
  • Like every backtester it flatters you until you subtract spread, slippage and overnight financing yourself
Install
pip install backtesting
Screenshots
kernc/backtesting.py: GitHub preview cardkernc/backtesting.py: Screenshot 1

Get the next edition in your inbox

A dozen repositories, opened and checked. The licence read, the last release dated, and the ones that did not make it named with the reason. It is the half most lists leave out.

No tracking pixels. One click to leave. The archive stays free either way.

We use your address to send the edition and nothing else. Confirm by email, leave in one click. How we handle it.