Welcome to the NSE Securities in Futures and Options Analyzer project! This project provides a comprehensive data analysis platform for stocks listed in the Futures and Options (F&O) segment of the National Stock Exchange (NSE) of India. It leverages Streamlit for a user-friendly web interface, fetches live data periodically, and provides analysis based on custom metrics.
- Overview
- Features
- Installation
- Usage
- Project Structure
- Detailed Breakdown
- Customization
- Future Enhancements
- Contributing
- License
- Contact Us
This project aims to provide real-time and historical analysis of stocks in the F&O segment of the NSE. The primary functionalities include fetching real-time stock data, processing this data to generate actionable insights, and providing a clean and interactive web interface for users to explore the data.
- Real-time Data Fetching: Automatically fetches data from NSE's official site every 30 minutes.
- Data Processing: Ranks stocks based on percentage change (%CHNG), identifies trading actions (buy/sell), and checks for 52-week highs and lows.
- Interactive Interface: Utilizes Streamlit to display data tables, charts, and provides a downloadable CSV of the processed data.
- Custom Analysis: Incorporates custom metrics and logic for in-depth stock analysis.
Ensure you have the following installed:
- Python 3.7+
- Pip (Python package installer)
-
Clone the Repository:
git clone https://github.com/opensourceops/nse-stock-fo-analyzer.git cd nse-fo-analysis -
Install Dependencies:
pip install -r requirements.txt
-
Run the Application:
streamlit run app.py
Upon starting the application, you can navigate to the provided local URL in your browser. The interface will display real-time data fetched from the NSE, along with processed metrics and analysis. The data will refresh every 30 minutes, with a countdown timer indicating the next update.
You can download the processed data as a CSV file. The filename will include the current date and time to distinguish between different datasets.
nse-fo-analysis/
├── app.py # Main application file
├── data/ # Directory for storing analysed csv data (if needed)
├── requirements.txt # List of Python dependencies
├── README.md # Project documentation
The data is fetched using the requests library, with a session object to manage cookies and headers required by NSE's API. The fetched data includes various stock metrics such as symbol, open, dayHigh, dayLow, previousClose, lastPrice, change, pChange, totalTradedVolume, totalTradedValue, yearHigh, yearLow, perChange30d, and perChange365d.
Data processing is handled by the StockDataProcessor class. Key functionalities include:
- Ranking stocks based on
%CHNG. - Identifying trading actions (buy/sell) based on specific conditions.
- Checking 52-week highs and lows to provide insights on stock performance.
The interface is built using Streamlit, providing a dynamic and interactive experience. Users can view the processed data, download it, and watch a countdown timer for the next data update.
You can customize the data processing logic by modifying the StockDataProcessor class. For example, you can add more conditions for trading actions or additional metrics for analysis.
- Integration with More Data Sources: Include additional financial data sources for a more comprehensive analysis.
- Advanced Visualization: Add more charts and graphs for better data visualization.
- User Authentication: Allow users to save their settings and preferences.
We welcome contributions! Please follow these steps:
- Fork the repository.
- Create a new feature branch (
git checkout -b feature-branch). - Commit your changes (
git add CHANGED_FILE && git commit -m 'Add new feature'). - Push to the branch (
git push origin feature-branch). - Create a new Pull Request.
MIT License
Join our Discord server: click this invite link.