Skip to content

niraj4rl/Stocker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

stocker — Regime-Aware Adaptive Stock Prediction

A machine learning system for NSE equity price prediction that dynamically selects its prediction strategy (regression vs classification) based on the current market regime.

Setup

pip install -r requirements.txt

Create local environment config from template:

cp .env.example .env

Fill .env with your local credentials. Do not commit .env.

Run the app

uvicorn ui.app:app --reload

Run backtest only

python -m backtest.engine --ticker RELIANCE.NS

Run tests

python -m pytest tests/

Project structure

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

How it works

  1. Fetches 5yr daily OHLCV for any NSE ticker via yfinance
  2. Engineers a technical feature matrix (RSI, MACD, Bollinger, lags, rolling stats)
  3. Detects current market regime: Bull / Bear / High-Volatility using HMM
  4. Routes prediction to the specialist model validated for that regime
  5. Outputs predicted price (regression) or direction + confidence (classification)

About

Stocker is a multi-model benchmarking platform for NSE stock prediction that reduces model uncertainty by selecting the optimal regressor per forecast horizon using hybrid performance ranking.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors