CoolFace
Apppublic

emmanuelmaekekioko/Nifty50-historical-analytics

sourceHugging Faceupdated 1y agoView on Hugging Face
4likes
App README

NIFTY 50 Analysis

A Streamlit-based web application for analyzing historical stock trends and market insights for NIFTY 50 companies. The app provides interactive visualizations, technical indicators, and news updates.

Features

  • —Sector and Company Analysis: Select a sector or specific NIFTY 50 company to analyze historical stock performance.
  • —Time Frames: Choose from 1D, 5D, 1M, 5M, 6M, YTD, 1Y, or 5Y periods, or specify a custom date range.
  • —Technical Indicators: Includes Bollinger Bands, MACD, RSI, and ATR for volatility and momentum analysis.
  • —Market Movers: Displays top gainers, losers, and most active stocks.
  • —Investment Growth: Simulates investment growth based on historical data.
  • —News Integration: Fetches recent news articles for selected companies or sectors using the News API.
  • —Interactive Visuals: Candlestick charts, scatter plots, and correlation matrices powered by Plotly.

Installation

  1. 1.Clone the repository:
bash
   git clone https://github.com/mtotowajemo0/nifty50-analysis.git
   cd nifty50-analysis
  1. 1.Create a virtual environment and install dependencies:
bash
   python -m venv venv
   source venv/bin/activate  # On Windows: venv\Scripts\activate
   pip install -r requirements.txt
  1. 1.Obtain a News API key from newsapi.org and replace the placeholder in app.py:
python
   newsapi = NewsApiClient(api_key="your-api-key-here")
  1. 1.Run the Streamlit app:
bash
   streamlit run app.py

Deployment on Hugging Face

  1. 1.Create a new Space on Hugging Face and select "Streamlit" as the app type.
  2. 2.Push your repository to Hugging Face:
bash
   git remote add huggingface https://huggingface.co/spaces/mtotowajemo/nifty50-analysis
   git push huggingface main
  1. 1.Set the News API key as a secret in your Hugging Face Space settings under Settings > Repository secrets.
  2. 2.Hugging Face will automatically deploy the app using app.py and requirements.txt.

Requirements

See requirements.txt for the full list of dependencies with versions.

Usage

  • —Select a sector and company from the sidebar.
  • —Choose a time frame or custom date range.
  • —Check options for technical indicators and visualizations.
  • —Click "Analyze" to view results, including candlestick charts, metrics, and news.

Notes

  • —This tool is for informational purposes only and does not constitute financial advice.
  • —Ensure your News API key is kept secure and not exposed in the code.
  • —Some features (e.g., 1D data) are tailored for Indian market hours (9:30 AM to 3:30 PM IST).

Contributing

Contributions are welcome! Please submit a pull request or open an issue for suggestions.

License

This project is licensed under the MIT License.