patternity


Namepatternity JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryPredict stock prices using a deterministic algorithm inspired by LSTM, focusing on pattern recognition in historical data.
upload_time2024-07-26 17:43:17
maintainerNone
docs_urlNone
authorArtyom Vancyan
requires_python>=3.9
licenseMIT
keywords finance crypto trading pattern prediction stock forex lstm deterministic
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            > [!CAUTION]  
> This project is intended for educational purposes only and does not constitute financial advice. The stock price
> predictions generated by this software are not guaranteed to be accurate and should not be relied upon for making
> investment decisions. The authors of this project are not responsible for any financial losses incurred as a result of
> using this software.

# 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

```bash
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.

```python
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.

![](https://github.com/user-attachments/assets/516c5acb-8324-4af1-9a7f-869acd185fb8)

## 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](https://github.com/ArtyomVancyan/patternity/blob/master/LICENSE)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "patternity",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": "finance, crypto, trading, pattern, prediction, stock, forex, lstm, deterministic",
    "author": "Artyom Vancyan",
    "author_email": "artyom.vancyan2000@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/e2/78/7f19c20c81ea4da42b083b5bcb2d1322a397f607a90587b2dacc90446f34/patternity-0.1.0.tar.gz",
    "platform": "unix",
    "description": "> [!CAUTION]  \n> This project is intended for educational purposes only and does not constitute financial advice. The stock price\n> predictions generated by this software are not guaranteed to be accurate and should not be relied upon for making\n> investment decisions. The authors of this project are not responsible for any financial losses incurred as a result of\n> using this software.\n\n# PATTERNITY\n\nThis project focuses on predicting stock prices using a deterministic algorithm inspired by the LSTM model of deep\nlearning. Unlike traditional statistical models, this approach leverages the power of pattern recognition to identify\nand repeat the most similar historical patterns in stock price data, with visualizations inspired by Google Finance\ncharts.\n\n## Usage\n\n```bash\npython3 -m pip install patternity\n```\n\nPatterity comes with collector functions to get historical data of an instrument. The following example demonstrates how\nto predict and plot the price of Bitcoin. For stocks, you can use the `get_stock` function instead. The `Pattern`\nclass (core) is used to predict the price of an instrument and has the following arguments.\n\n- `history` - Historical data of an instrument (required).\n- `window` - The minimum length of the pattern window to be considered. (optional)\n- `progress` - Callback function to track the progress of the prediction. Recommended for large historical data.\n\n```python\nfrom patternity import Pattern, get_crypto\nfrom rich.progress import track\n\nif __name__ == \"__main__\":\n    history = get_crypto(\"BTCUSDT\", depth=200)\n    pattern = Pattern(history, progress=track)\n    pattern.predict()\n    pattern.plot()\n```\n\nIf everything is set up correctly, you should see a plot similar to the one below. If nothing was predicted, try on\nlarger historical data. Also, you can change the `window` parameter to adjust the minimum length of the pattern to be\nrecognized. The higher the `window`, the more accurate the prediction will be and longer it will take to compute.\n\n![](https://github.com/user-attachments/assets/516c5acb-8324-4af1-9a7f-869acd185fb8)\n\n## Contribute\n\nAny contribution is welcome. Don't hesitate to open an issue or a discussion if you have any questions not covered by\nthe documentation. Please open a pull request if you have any ideas or suggestions on optimizing the algorithm.\n\n## License\n\nCopyright (C) 2024 Artyom Vancyan. [MIT](https://github.com/ArtyomVancyan/patternity/blob/master/LICENSE)\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Predict stock prices using a deterministic algorithm inspired by LSTM, focusing on pattern recognition in historical data.",
    "version": "0.1.0",
    "project_urls": {
        "Source Code": "https://github.com/ArtyomVancyan/patternity/"
    },
    "split_keywords": [
        "finance",
        " crypto",
        " trading",
        " pattern",
        " prediction",
        " stock",
        " forex",
        " lstm",
        " deterministic"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b8a0d4d6624f24cfa3804c72cf634a8ffe418b3ec0616e1041c2976eba3cfb9f",
                "md5": "d59e21d18f6181c22cec94eadbe60080",
                "sha256": "71cf8e66bd0feb9c78e586827e29fa12b7b03f3c3bbdd14d20bc50fcbd61418e"
            },
            "downloads": -1,
            "filename": "patternity-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d59e21d18f6181c22cec94eadbe60080",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 6263,
            "upload_time": "2024-07-26T17:43:16",
            "upload_time_iso_8601": "2024-07-26T17:43:16.526934Z",
            "url": "https://files.pythonhosted.org/packages/b8/a0/d4d6624f24cfa3804c72cf634a8ffe418b3ec0616e1041c2976eba3cfb9f/patternity-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e2787f19c20c81ea4da42b083b5bcb2d1322a397f607a90587b2dacc90446f34",
                "md5": "708095d152c6a6996f4af2facfde8602",
                "sha256": "51c2d55e319ff642dbbf53eb1249810635df74929dcfd0e445129bd18429395c"
            },
            "downloads": -1,
            "filename": "patternity-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "708095d152c6a6996f4af2facfde8602",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 6148,
            "upload_time": "2024-07-26T17:43:17",
            "upload_time_iso_8601": "2024-07-26T17:43:17.504629Z",
            "url": "https://files.pythonhosted.org/packages/e2/78/7f19c20c81ea4da42b083b5bcb2d1322a397f607a90587b2dacc90446f34/patternity-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-07-26 17:43:17",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ArtyomVancyan",
    "github_project": "patternity",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "patternity"
}
        
Elapsed time: 0.54838s