4.2k stars · BSD-3-Clause · v1.14.1 (2026-02-08)
Matrix profile — finds every repeating shape and every anomaly in a long time series without being told what to look for.
▶Repo detailsthe review · specs · pros & cons · install
What it is
It computes the matrix profile of a time series, which finds every repeated shape (motif) and every anomaly (discord) in a long series — without you specifying what to look for. It scales to millions of points using Numba, multiprocessing or Dask.
Why it matters
You've said the goal is to find one working pattern targeting about 2% a month, and you already have three years of EURUSD loaded. Most people attack that by guessing indicator combinations. This inverts it: the data tells you which price shapes actually recur, and each discovered motif becomes a candidate entry signal you can hand straight to a backtester. stumpy.match() then detects that same shape on live bars. It is the difference between searching and hunting.
- Finds patterns with no labels, no training, no ML expertise required
- BSD-3 — no restriction on shipping it inside a commercial ScalpingMate
- Well documented, with finance-flavoured tutorials and a real maintainer team
- Memory and CPU scale with series length — three years of M1 data is roughly a million points and will need chunking
- Raw motifs are not strategies. Most repeating shapes have no forward edge, so expect heavy filtering
- Choosing the window length is a judgement call that changes everything downstream
Pair with kernc/backtesting.py to test each surviving motif.
A FastAPI job pulls the price array from PostgreSQL, runs stumpy.stump() , and stores motif indices and distances in a table; the React side plots the top motifs as overlaid mini-charts for you to accept or reject.
