PATTERNITY
This project focuses on predicting stock prices using a deterministic algorithm inspired by the LSTM model of deep learning. Unlike traditional statistical models, this approach leverages the power of pattern recognition to identify and repeat the most similar historical patterns in stock price data, with visualizations inspired by Google Finance charts.
Usage
python3 -m pip install patternity
Patterity comes with collector functions to get historical data of an instrument. The following example demonstrates how
to predict and plot the price of Bitcoin. For stocks, you can use the get_stock function instead. The Pattern
class (core) is used to predict the price of an instrument and has the following arguments.
history- Historical data of an instrument (required).window- The minimum length of the pattern window to be considered. (optional)progress- Callback function to track the progress of the prediction. Recommended for large historical data.
from patternity import Pattern, get_crypto
from rich.progress import track
if __name__ == "__main__":
history = get_crypto("BTCUSDT", depth=200)
pattern = Pattern(history, progress=track)
pattern.predict()
pattern.plot()
If everything is set up correctly, you should see a plot similar to the one below. If nothing was predicted, try on
larger historical data. Also, you can change the window parameter to adjust the minimum length of the pattern to be
recognized. The higher the window, the more accurate the prediction will be and longer it will take to compute.
Contribute
Any contribution is welcome. Don't hesitate to open an issue or a discussion if you have any questions not covered by the documentation. Please open a pull request if you have any ideas or suggestions on optimizing the algorithm.
License
Copyright (C) 2024 Artyom Vancyan. MIT
Metadata
Release files for patternity 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| patternity-0.1.0.tar.gz | 6.1 kB | Without provenance | Details for patternity-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| patternity-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for patternity-0.1.0-py3-none-any.whl |
Total release size: 12.4 kB
Release files / patternity-0.1.0.tar.gz
| Download URL | patternity-0.1.0.tar.gz |
|---|---|
| Size | 6.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
51c2d55e319ff642dbbf53eb1249810635df74929dcfd0e445129bd18429395c
|
|
BLAKE2b-256 checksum How to use checksums |
e2787f19c20c81ea4da42b083b5bcb2d1322a397f607a90587b2dacc90446f34
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Release files / patternity-0.1.0-py3-none-any.whl
| Download URL | patternity-0.1.0-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
71cf8e66bd0feb9c78e586827e29fa12b7b03f3c3bbdd14d20bc50fcbd61418e
|
|
BLAKE2b-256 checksum How to use checksums |
b8a0d4d6624f24cfa3804c72cf634a8ffe418b3ec0616e1041c2976eba3cfb9f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.12.4
|
Security for patternity 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.