Open
Conversation
This commit introduces several improvements to the stock price prediction capabilities:
1. **Refactored Prediction Logic**:
* Prediction logic (feature engineering, training, prediction) has been centralized into a new `PredictionService` class located in `src/stock_tracker/services/prediction_service.py`.
* This improves modularity and maintainability.
2. **Enhanced Feature Engineering**:
* The feature set for tree-based models (Random Forest, Gradient Boosting) has been significantly enhanced. It now incorporates a comprehensive suite of technical indicators (e.g., RSI, MACD, Bollinger Bands, etc.) from `TechnicalAnalysis`, in addition to price/volume-based features and lags.
3. **Added Gradient Boosting Regressor**:
* A Gradient Boosting Regressor model option has been added, providing you with another advanced prediction model choice.
4. **Updated Streamlit Applications**:
* Both `src/stock_tracker/main.py` and `enhanced_app.py` have been updated to use the `PredictionService`.
* The UI in both apps now lists "Gradient Boosting Regressor" as a selectable model.
5. **Added Unit Tests**:
* Comprehensive unit tests for the `PredictionService` have been added in `tests/test_prediction_service.py`, covering feature creation, model training/prediction for all supported models, and edge case handling (e.g., insufficient data).
6. **Updated Documentation**:
* `README.md` has been updated to reflect the new model, enhanced feature engineering, and the updated project structure including `prediction_service.py`.
These changes aim to improve the accuracy and robustness of the prediction models and provide a more organized and extensible codebase.
This commit introduces an email notification system for stock alerts.
Key changes:
1. **EmailService Implementation (`src/stock_tracker/services/email_service.py`)**:
* Added a new `EmailService` class capable of sending emails via SMTP.
* The service is configured using environment variables (`SMTP_HOST`, `SMTP_PORT`, `SMTP_USER`, `SMTP_PASSWORD`, `SENDER_EMAIL`).
* Includes robust error handling and logging for email sending operations.
2. **Configuration Guidance (`docs/EMAIL_SETUP.md`)**:
* Created a comprehensive guide explaining how to set up the required environment variables, with examples for Gmail (using App Passwords) and generic SMTP servers.
3. **AlertSystem Integration (`src/stock_tracker/utils/alert_system.py`)**:
* The `check_alerts` method in `AlertSystem` now uses the `EmailService` to send notifications when an alert is triggered.
* Emails are sent to you if the email service is configured and your email is available.
4. **Unit Tests (`tests/test_email_service.py`)**:
* Added unit tests for `EmailService`, covering initialization, configuration handling, successful email sending (mocked), and various error scenarios.
5. **Documentation Updates (`README.md`)**:
* Updated the main `README.md` to mention the new email notification feature for alerts and to link to the `docs/EMAIL_SETUP.md` guide for configuration instructions.
This feature allows you to receive timely email notifications when your configured stock alerts are triggered, enhancing the monitoring capabilities of the application.
This commit introduces a series of UI and UX enhancements to `enhanced_app.py` to create a more modern, visually appealing, and user-friendly experience.
Key improvements:
1. **Custom Streamlit Theme**:
* Applied a new dark theme via `.streamlit/config.toml` with a modern color palette (dark backgrounds, vibrant blue primary color, light text) and sans-serif font for a consistent and professional look.
2. **Dashboard Revamp**:
* Redesigned top metrics (Portfolio Value, Active Alerts, Analyses) for better visual impact using icons and styled titles.
* Improved the "Portfolio Allocation" pie chart (now a donut chart) with clearer labels and percentages directly on slices.
* Enhanced visual separation for "Recent Analysis" and "Portfolio Overview" sections using containers and horizontal rules.
3. **Improved Graph Readability**:
* Enhanced Plotly charts on "Stock Analysis" and "Advanced TA" pages.
* Standardized titles, axis labels, and legends for clarity.
* Implemented custom `hovertemplate`s for detailed tooltips on chart traces (OHLC, indicator values).
* Used `hovermode="x unified"` for a better shared tooltip experience.
* Ensured charts integrate well with the new dark theme.
4. **Refined Page Layouts**:
* **Stock Analysis Page**: Organized technical indicators into a tabbed interface ("Overview & Price", "RSI", "MACD", "More Indicators") for better structure.
* **Alerts Page**: Improved the display of active alerts using containers, markdown for clearer details, dividers for separation, and a more descriptive delete button.
* **Portfolio Page**: Reviewed and maintained clear presentation of summary metrics and holdings.
5. **Consistent Iconography**:
* Introduced relevant emoji icons across the application (sidebar navigation, page titles, section headers, buttons, expanders) to improve visual appeal, scannability, and user guidance.
These changes collectively aim to significantly improve the overall look, feel, and usability of the application.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.