An AI-powered Streamlit dashboard that connects to Zerodha Kite, forecasts next-day volatility with MGARCH (DCC), visualizes correlations, and provides risk-aware insights with paper/real trade workflows.
- Live/historical data via Zerodha Kite Connect (with synthetic fallback if not logged in)
- MGARCH (DCC) volatility forecasts via
arch, with safe univariate/rolling fallbacks - Plotly visualizations: prices, rolling volatility, animated correlation heatmap, correlation-over-time
- Risk KPIs: forecasted volatility, suggested stop-loss, position sizing
- Paper trading simulator and real trading scaffold (map indices to tradable instruments)
- Modern dark UI with glassmorphism styling
app.py— Streamlit applicationrequirements.txt— Python dependencies.streamlit/config.toml— UI theme (optional)
- Python 3.10+
- Zerodha Kite Connect API key/secret (for live data and real orders)
# 1) Create and activate a virtual environment (recommended)
python -m venv .venv
. .venv/Scripts/activate # Windows PowerShell: .venv\Scripts\Activate.ps1
# 2) Install dependencies
pip install -r requirements.txtstreamlit run app.pyThen open the URL shown (usually http://localhost:8501).
- Enter your
API KeyandAPI Secretin the sidebar. - Click the generated login URL, complete login on Zerodha to obtain a
request_token. - Paste the
request_tokenback in the app and click "Generate Access Token". - On success, live data and real trading endpoints become available.
Note: Index symbols like Nifty 50, Nifty IT, Nifty FMCG are not directly tradable. For real trades, map to tradable instruments like ETFs (e.g., NIFTYBEES) or futures before placing orders. The app’s real trading function is a placeholder and intentionally skips order placement until you wire correct mappings.
- Primary: MGARCH DCC built using
arch.multivariate.DynamicConditionalCorrelation - Fallbacks: univariate GARCH(1,1) per series, or rolling standard deviation
- Forecasts reported as annualized volatility (%)
- Stop-loss suggestion = volatility × multiplier (configurable)
- Position sizing uses risk-per-trade % and stop-loss distance
- Manual refresh button clears caches and reloads
- Optional auto-refresh every 60 seconds
- Add an LSTM model on returns to compare with MGARCH forecasts and report accuracy
- For educational and paper trading use. Markets are risky; no guarantees.
- Ensure compliance with broker APIs and exchange regulations.
- Never deploy real trading without thorough testing and proper risk controls.
Developed by Maithili Sharma | Department of AI, Vishwakarma University