A professional trading analytics platform that leverages Angel One's SmartAPI to fetch, analyze, and manage stock market data with precision. This robust application provides comprehensive functionality for both historical and real-time stock data analysis.
-
Install the required dependencies:
pip install -r requirements.txt -
Configure your API credentials:
- Open
config.py - Update the following variables with your actual credentials:
API_KEY: Your Angel One API keyCLIENT_CODE: Your client code (not email)MPIN: Your MPINTOTP_SECRET: Your valid Base32-encoded TOTP secret
- Open
Run the main application:
python main.py
This will display a menu with the following options:
-
Fetch historical data for a specific stock
- Fetches daily historical data for a specific stock (configured in
config.py) - Saves data to
historical_data.csv
- Fetches daily historical data for a specific stock (configured in
-
Fetch historical data for all stocks in portfolio
- Fetches daily historical data for all stocks in your portfolio
- Saves data to
portfolio_stocks_jan_to_mar.csv
-
Fetch full history of all stocks in portfolio
- Fetches daily historical data for all stocks in your portfolio from their purchase dates
- Saves data to
portfolio_stocks_full_history.csv
-
Fetch minute-level data for a specific stock
- Fetches minute-level data for a specific stock (configured in
config.py) - Fetches data in batches to avoid API limits
- Saves data to
[STOCK_SYMBOL]_minute_data.csv
- Fetches minute-level data for a specific stock (configured in
main.py: Main entry point for the applicationconfig.py: Configuration settings and API credentialsutils.py: Utility functions for API operationsfetch_historical_data.py: Script to fetch historical data for a specific stockfetch_portfolio_data.py: Script to fetch historical data for all stocks in portfoliofetch_portfolio_full_history.py: Script to fetch full history of all stocks in portfoliofetch_minute_data.py: Script to fetch minute-level data for a specific stockrequirements.txt: List of required dependencies
- Make sure to keep your API credentials secure
- The application uses TOTP (Time-based One-Time Password) for authentication
- Data is fetched in batches to avoid API rate limits