A machine learning system for NSE equity price prediction that dynamically selects its prediction strategy (regression vs classification) based on the current market regime.
pip install -r requirements.txtCreate local environment config from template:
cp .env.example .envFill .env with your local credentials. Do not commit .env.
uvicorn ui.app:app --reloadpython -m backtest.engine --ticker RELIANCE.NSpython -m pytest tests/stocker/
├── data/ # Data ingestion and storage
├── features/ # Feature engineering
├── regime/ # Regime detection (heuristic + HMM)
├── models/ # Per-regime model training and registry
├── router/ # Adaptive paradigm router
├── backtest/ # Walk-forward backtester and metrics
├── ui/ # FastAPI + HTML/Tailwind/JS frontend
├── utils/ # Shared helpers
└── tests/ # Unit tests
- Fetches 5yr daily OHLCV for any NSE ticker via yfinance
- Engineers a technical feature matrix (RSI, MACD, Bollinger, lags, rolling stats)
- Detects current market regime: Bull / Bear / High-Volatility using HMM
- Routes prediction to the specialist model validated for that regime
- Outputs predicted price (regression) or direction + confidence (classification)