A Flask-based stock market dashboard that displays TradingView-style charts using OpenAlgo API data with technical indicators like EMA and RSI.
- Real-time stock quotes from OpenAlgo API
- Interactive TradingView Lightweight Charts
- Multiple timeframes support (1m, 5m, 15m, 30m, 1h, 4h, daily, weekly, monthly)
- Technical indicators (EMA, RSI)
- Theme toggle (light/dark mode)
- Auto-update functionality
- Watchlist for quick access to previously viewed symbols
- Python 3.6+
- Flask
- OpenAlgo API client
- pandas
-
Clone this repository or download the files:
git clone https://github.com/marketcalls/stock-dashboard.git cd stock-dashboard -
Create and activate a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows, use: venv\Scripts\activate -
Install the required packages:
pip install -r requirements.txt -
Set up environment variables:
cp .env.sample .envThen edit the
.envfile and add your OpenAlgo API key and other configuration options.
stock-market-dashboard/
├── app.py # Flask application
├── .env.sample # Sample environment variables file
├── .env # Your actual environment variables (not committed to git)
├── requirements.txt # Python dependencies
└── templates/
├── index.html # Home page
└── charts.html # TradingView charts page
-
Make sure the OpenAlgo API server is running on
http://127.0.0.1:5000 -
Run the Flask application:
python app.py -
Open your browser and navigate to
http://127.0.0.1:5001
- Navigate to the Charts page
- Enter a stock symbol (e.g., SBIN) and select the exchange (NSE, BSE, etc.)
- Choose a timeframe from the interval dropdown
- Adjust EMA and RSI periods if desired
- Click "Fetch Data" to load the chart
- Toggle between light and dark themes using the "Toggle Theme" button
- Enable auto-update if you want the chart to refresh automatically
The application supports all intervals provided by the OpenAlgo API:
- Minutes: 1m, 2m, 3m, 5m, 10m, 15m, 20m, 30m
- Hours: 1h, 2h, 4h
- Days: D (daily)
- Weeks: W (weekly)
- Months: M (monthly)
If you encounter issues with the chart library:
- Check the browser console for errors
- Make sure the TradingView Lightweight Charts library is loading correctly
- Verify that the OpenAlgo API server is running
- Check that the data format matches what the charts expect
For security purposes, you should store your OpenAlgo API key in an environment variable or a configuration file that is not committed to version control. In the example code, replace the hardcoded API key with:
import os
# Get API key from environment variable
api_key = os.environ.get('OPENALGO_API_KEY')Never share your API keys in public repositories or documentation.