{"id":29201930,"url":"https://github.com/bdr-pro/iv-stock-predictor","last_synced_at":"2025-07-02T12:36:32.833Z","repository":{"id":293988597,"uuid":"985697796","full_name":"BDR-Pro/iv-stock-predictor","owner":"BDR-Pro","description":" Delta IV Forecasting with XGBoost \u0026 LSTM (Stock Options)","archived":false,"fork":false,"pushed_at":"2025-05-18T10:40:49.000Z","size":0,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-18T11:37:08.623Z","etag":null,"topics":["machine-learning","stock-price-prediction"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BDR-Pro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-05-18T10:39:04.000Z","updated_at":"2025-05-18T10:48:24.000Z","dependencies_parsed_at":"2025-05-18T11:38:09.611Z","dependency_job_id":"98f2f1a5-5aaf-496c-9a05-78eb31176ec3","html_url":"https://github.com/BDR-Pro/iv-stock-predictor","commit_stats":null,"previous_names":["bdr-pro/iv-stock-predictor"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/BDR-Pro/iv-stock-predictor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BDR-Pro%2Fiv-stock-predictor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BDR-Pro%2Fiv-stock-predictor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BDR-Pro%2Fiv-stock-predictor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BDR-Pro%2Fiv-stock-predictor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BDR-Pro","download_url":"https://codeload.github.com/BDR-Pro/iv-stock-predictor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BDR-Pro%2Fiv-stock-predictor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263141282,"owners_count":23420046,"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":["machine-learning","stock-price-prediction"],"created_at":"2025-07-02T12:36:29.592Z","updated_at":"2025-07-02T12:36:32.819Z","avatar_url":"https://github.com/BDR-Pro.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🧠 IV Delta Forecasting with XGBoost and LSTM\n\nThis notebook predicts the **daily change in implied volatility (ΔIV)** for SPY (S\\\u0026P 500 ETF) options using two distinct ML approaches:\n\n* 🔺 **Quantile Regression with XGBoost**\n* 🔁 **Sequential Forecasting with LSTM (Neural Network)**\n\n## 📦 How It Works\n\n### 1. **Data Collection**\n\n* SPY (price, volume) and VIX (volatility index) are downloaded using `yfinance`.\n* IV is approximated using 5-day rolling standard deviation of SPY returns.\n* Target: **ΔIV = IV(t+1) - IV(t)**\n\n### 2. **Feature Engineering**\n\n* Market features: SPY returns, VIX, volume changes\n* Option-style metadata: random DTE, call/put indicator\n* Lagged IV/delta\\_IV values\n* Prophet-derived seasonal features (`trend`, `weekly`)\n\n### 3. **Quantile XGBoost**\n\n* Trains separate models for 10th, 50th, 90th percentiles\n* Visualizes median forecast + confidence band (10–90%)\n* Metrics: MAE, MSE, R², Directional Accuracy\n\n### 4. **LSTM Model**\n\n* Uses 60-day sequences of engineered features\n* Predicts ΔIV using a simple 1-layer LSTM\n* Evaluates performance and plots predictions + residuals\n\n---\n\n## 📈 Example Output\n\n| Model   | MAE    | R²      | Directional Accuracy |\n| ------- | ------ | ------- | -------------------- |\n| XGBoost | 0.0073 | -6.5655 | 42.4%                |\n| LSTM    | 0.0029 | -4.4223 | 59.1%                |\n\n---\n\n## 🛠 Requirements\n\nInstall dependencies using:\n\n```bash\npip install yfinance prophet xgboost scikit-learn keras tensorflow\n```\n\n---\n\n## ✅ Future Improvements\n\n* Replace rolling IV with real implied volatility (from options chain)\n* Use earnings calendar and macroeconomic events\n* Test more advanced LSTM/Transformer architectures\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdr-pro%2Fiv-stock-predictor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbdr-pro%2Fiv-stock-predictor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdr-pro%2Fiv-stock-predictor/lists"}