Discover repeating patterns in financial time series using STUMPY — a powerful and scalable Python library for time series analysis based on the Matrix Profile.
This repository contains a Jupyter notebook that walks through how to use STUMPY to detect recurring patterns (motifs) and anomalies (discords) in financial instrument price data — a great starting point for building pattern-based trading strategies or just exploring time series analysis.
Check out the full video tutorial here: [Insert your YouTube link here]
- An introduction to the Matrix Profile concept
- How to load and prep financial time series data
- Using STUMPY to find motifs (repeating patterns) and discords (anomalies)
- Visualizing detected patterns on price charts
- Python 3.8+
- Jupyter Notebook or JupyterLab
git clone https://github.com/yourusername/pattern-detection-for-trading.git
cd pattern-detection-for-trading
pip install -r requirements.txtOpen the notebook and run through the cells:
jupyter notebook pattern_detection.ipynb- STUMPY — for computing the Matrix Profile and detecting patterns
This project is for educational purposes only and does not constitute financial advice. Trading involves risk — always do your own research before making investment decisions.
Found a bug or have an idea for improvement? Feel free to open an issue or submit a pull request!
This project is licensed under the MIT License — see the LICENSE file for details.
⭐ If you found this helpful, consider giving the repo a star — it really helps!