How vighnesh-6/sector-rotation-regime-discovery- works
This repository combines an Indian-market regime-discovery research codebase with a deployed analytics dashboard and data-ingestion services. The research workflow spans loading and preparing market data, discovering and characterizing regimes, then evaluating portfolio strategies and robustness. Deployment adds market and macro-event ingestion, database-backed APIs, and dashboard views. The graph preserves these distinct product areas; links are limited to relationships visible in sampled source, the source index, or explicit documentation. Several deployment and research modules were not sampled, so their internal connections are left out.
Main entry points: regime_characterisation.py Regime characterization · portfolio_backtest.py Portfolio backtest · database.py Event database adapter · comparative_evaluation.py Comparative evaluation
Components 27
Research Data
- Market data loader
src/data_loader.py - Data cleaning
src/data_cleaning.py - Normalization
src/normalization.py - Feature engineering
src/feature_engineering.py - Event analysis
src/event_analysis.py
Regime Analysis
- Regime discovery
src/regime_discovery.py - Regime characterization
src/regime_characterisation.py - Rotation rules
src/regime_rotation_rules.py
Strategy Evaluation
- Portfolio construction
src/portfolio_construction.py - Portfolio backtest
src/portfolio_backtest.py - Benchmark backtest
src/benchmark_backtest.py - Comparative evaluation
src/comparative_evaluation.py - Robustness analysis
src/robustness - Statistical validation
src/statistical_validation.py
Data Services
- Candle catch-up
deployment/ingestion/catchup_fetcher.py - Yahoo client
deployment/ingestion/yfinance_client.py - Market database
deployment/database/connection.py - Macro event collection
deployment/events/daily_collector.py - Event storage
deployment/events/storage.py - Event database adapter
deployment/events/database.py - Workflow dispatcher
deployment/automation/lib/dispatcher.mjs
Analytics Dashboard
- Analytics views
deployment/web/app - Analytics API routes
deployment/web/app/api/v1
Other components
- Research user
- Yahoo Finance
- Neon database
- GitHub API
Connections 20
- Research user → Market data loader: loads data
- Market data loader → Regime characterization: supplies features
- Regime characterization → Normalization: uses
src/regime_characterisation.py - Regime discovery → Regime characterization: produces regimes
- Regime characterization → Portfolio construction: informs portfolios
- Portfolio construction → Portfolio backtest: constructs inputs
- Portfolio backtest → Comparative evaluation: evaluated by
src/robustness/execution_sensitivity.py - Benchmark backtest → Comparative evaluation: compared by
src/robustness/benchmark_sensitivity.py - Portfolio backtest → Robustness analysis: sensitivity inputs
src/robustness/execution_sensitivity.py - Benchmark backtest → Robustness analysis: sensitivity inputs
src/robustness/benchmark_sensitivity.py - Comparative evaluation → Robustness analysis: sensitivity inputs
src/robustness/benchmark_sensitivity.py - Yahoo Finance → Yahoo client: provides prices
- Candle catch-up → Yahoo client: fetches candles
deployment/ingestion/catchup_fetcher.py - Candle catch-up → Market database: queries and writes
deployment/ingestion/catchup_fetcher.py - Macro event collection → Event storage: stores events
- Event storage → Event database adapter: queries and transacts
deployment/events/storage.py - Event database adapter → Market database: inherits client
deployment/events/database.py - Event database adapter → Neon database: runs SQL batches
deployment/events/database.py - Research user → Analytics views: views analytics
- Workflow dispatcher → GitHub API: dispatches workflows
deployment/automation/lib/dispatcher.mjs