Welcome to the Stock Risk Analyzer Wiki! This project leverages machine learning techniques to analyze stock data and provide risk classifications (Low, Medium, High). It鈥檚 designed to help investors and analysts make informed decisions with real-time data.
Stock Risk Analyzer is an open-source application that combines financial data with machine learning to evaluate stock risk levels. By leveraging historical data and advanced technical indicators, the application enables users to:
- Assess risk levels of individual stocks.
- Make informed investment decisions.
- Perform real-time analysis using an intuitive web interface or command-line tools.
-
Machine Learning Classification:
- Uses LightGBM for fast and accurate risk predictions.
- Labels stocks as
Low,Medium, orHighrisk.
-
Real-Time Stock Data:
- Integrates with the Yahoo Finance API for fetching historical and current stock data.
-
Technical Indicator Calculations:
- Computes key indicators such as Moving Averages (MA50, MA200), RSI, Volatility, and Bollinger Bands.
-
User-Friendly Web Interface:
- Built with Flask, allowing users to analyze stocks through a simple browser interface.
-
CLI Support:
- Analyze stocks programmatically via a command-line interface.
-
Extensibility:
- Modular codebase allows easy integration of new features or additional data sources.
- Python 3.8 or higher
- Git (for cloning the repository)
-
Clone the repository:
git clone https://github.com/skytells-research/stock-risk-analyzer.git cd stock-risk-analyzer -
Create a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
-
Install the dependencies:
pip install -r requirements.txt
-
(Optional) Train the model:
python model_training.py
Note: Pre-trained models are included in the repository.
- Start the Flask app:
python app.py
- Open your browser and navigate to
http://localhost:5000. - Enter a stock ticker (e.g.,
AAPL) to analyze its risk level.
- Run the
app.pyscript with the desired ticker:Replacepython app.py --ticker AAPL
AAPLwith your desired stock ticker.
Contributions are welcome! Follow these steps to contribute:
- Fork the repository.
- Create a feature branch:
git checkout -b feature/your-feature
- Commit your changes:
git commit -m "Add your feature" - Push to your branch:
git push origin feature/your-feature
- Open a pull request.
- Languages: Python
- Libraries:
- Flask (Web Framework)
- yfinance (Stock Data)
- scikit-learn (ML Algorithms)
- LightGBM (ML Classifier)
- pandas/numpy (Data Processing)
- TA-Lib (Technical Indicators)
This project is licensed under the MIT License. Feel free to use, modify, and distribute as per the terms of the license.