{"id":21874015,"url":"https://github.com/ianjure/mean-reversion-trading","last_synced_at":"2026-04-24T12:04:30.562Z","repository":{"id":255455049,"uuid":"852207929","full_name":"ianjure/mean-reversion-trading","owner":"ianjure","description":"A trading algorithm based on a popular financial theory.","archived":false,"fork":false,"pushed_at":"2024-09-05T04:49:57.000Z","size":124,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T23:17:22.286Z","etag":null,"topics":["algorithmic-trading","simulation","streamlit","trading","trading-algorithms"],"latest_commit_sha":null,"homepage":"https://tradestrats.streamlit.app/meanreversion","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ianjure.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-04T12:16:56.000Z","updated_at":"2024-09-05T04:52:32.000Z","dependencies_parsed_at":"2024-09-10T07:02:29.515Z","dependency_job_id":null,"html_url":"https://github.com/ianjure/mean-reversion-trading","commit_stats":null,"previous_names":["ianjure/mean-reversion-trading"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ianjure/mean-reversion-trading","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianjure%2Fmean-reversion-trading","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianjure%2Fmean-reversion-trading/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianjure%2Fmean-reversion-trading/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianjure%2Fmean-reversion-trading/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ianjure","download_url":"https://codeload.github.com/ianjure/mean-reversion-trading/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ianjure%2Fmean-reversion-trading/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262862409,"owners_count":23376405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithmic-trading","simulation","streamlit","trading","trading-algorithms"],"created_at":"2024-11-28T07:10:29.995Z","updated_at":"2026-04-24T12:04:30.504Z","avatar_url":"https://github.com/ianjure.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mean Reversion Trading \u0026nbsp; [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ianjure/mean-reversion-trading/blob/main/Mean_Reversion_Notebook.ipynb) \u0026nbsp; [![Static Badge](https://img.shields.io/badge/Visit%20the%20Website-red?style=flat\u0026logo=streamlit\u0026logoSize=auto\u0026labelColor=%23ffffff\u0026color=%23ff4b4c)](https://tradestrats.streamlit.app/meanreversion)\n\nMean reversion is a financial theory that suggests asset prices tend to return to their average levels after an extreme price movement. The goal of this project is to develop an algorithm that replicates this strategy and simulates its returns using historical stock data.\n\n## Data Overview\nWe will retrieve historical price data for the stock from Yahoo Finance using the [yfinance](https://pypi.org/project/yfinance/) library. This dataset will include the closing prices, which are crucial for simulating the trading strategy. Additionally, we will use [pandas-ta](https://pypi.org/project/pandas-ta/), a technical analysis library, to calculate two key indicators: the Relative Strength Index (RSI) and the Simple Moving Average (SMA).\n\n## Project Method\n1. **Collect the Data:** Retrieve stock price data from Yahoo Finance.\n2. **Clean the Data:** Remove irrelevant features and standardize the index format.\n3. **Create New Features:** Use pandas-ta to calculate the 10-period RSI and 200-period SMA.\n4. **Simulate the Strategy:** Apply the entry and exit conditions to execute the strategy and calculate the expected returns.\n5. **Deploy the Model:** Develop a web application that allows users to test the model.\n\n## Next Steps\n* **Explore** and evaluate additional trading strategies.\n* **Experiment** with different combinations of RSI and SMA periods.\n\n\u003cbr\u003e\n\n**This project is inspired by:** [Mean Reversion Trading Strategy Using Python](https://eodhd.medium.com/testing-a-powerful-mean-reversion-trading-strategy-using-python-4eb5eed60857)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianjure%2Fmean-reversion-trading","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fianjure%2Fmean-reversion-trading","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fianjure%2Fmean-reversion-trading/lists"}