Indian Bank Stock Price Prediction Models (Advanced Signals + Macro Indicators)

This repository contains 8 trained V5 Transformer models with 126 optimized features for predicting next-day price movements of major Indian banking stocks.

🎯 Key Features: Professional-Grade Macro Integration

Feature Category Count Weight Purpose
Technical Indicators 35 1x Price action, momentum, volatility
FinBERT Sentiment 4 2x News sentiment analysis
Advanced Signals 12 2x Analyst ratings, risk, earnings
Nifty Bank Index 3 8x Market correlation
USD/INR Forex 7 5x FII sentiment, INR weakness
Total Features 126 - Optimized to prevent overfitting

πŸ’‘ Why USD/INR Integration Matters

Critical Macro Indicator for Indian Markets:

  • INR Weakening β†’ FII selling pressure β†’ Bearish market sentiment
  • INR Strengthening β†’ FII buying interest β†’ Bullish market sentiment
  • Current Signal (Jan 2026): β‚Ή91.54, +0.72% weakness = STRONG BEARISH

This model captures what institutional traders watch: currency movements as a leading indicator of foreign capital flows.

πŸ“Š Latest Training Results (January 2026)

Stock Directional Accuracy Avg Confidence High Conf Accuracy
HDFC Bank 100% 99.94% 100%
ICICI Bank 100% 93.80% 100%
Kotak Mahindra Bank 100% 99.86% 100%
Axis Bank 100% 75.65% 100%
State Bank of India 100% 97.29% 100%
Punjab National Bank 100% 46.02% 100%
Bank of Baroda 100% 84.70% 100%
Canara Bank 100% 75.38% 100%

Average: 100% directional accuracy, 84.08% confidence

πŸ—οΈ Model Architecture

  • Type: V5 Transformer with Multi-Task Learning
  • Features: 126 (35 technical + 4 FinBERT + 12 advanced + 3 Nifty Bank + 7 USD/INR + duplicates)
  • Lookback: 30 days (optimized for responsiveness)
  • Parameters: ~517,534 per model
  • Tasks: Direction classification (70%) + Magnitude regression (30%)

Feature Breakdown (126 Total):

Base Features (61):

  • Technical Indicators (35): Price, volume, moving averages, RSI, MACD, Bollinger Bands, ATR, ADX
  • FinBERT Sentiment (4): sentiment_polarity, sentiment_score, news_volume, earnings_event
  • Advanced Signals (12): technical_signal, analyst_rating, macro_signal, risk_score, leadership_signal, earnings_signal
  • Nifty Bank Index (3): 1d, 5d, 20d returns (market correlation)
  • USD/INR Forex (7): rate, 1d/5d/20d changes, momentum, volatility, INR weakness score

Weighted Duplicates (65):

  • Nifty Bank 8x: 21 duplicates (strong market correlation signal)
  • USD/INR 5x: 28 duplicates (critical FII sentiment indicator)
  • Sentiment 2x: 16 duplicates (FinBERT + Advanced combined)

🎨 USD/INR Forex Features (Critical Innovation)

7 Features Capturing FII Sentiment:

  1. usd_inr_rate: Current exchange rate
  2. usd_inr_change_1d/5d/20d: Multi-horizon rate changes
  3. usd_inr_momentum: 5-day rolling momentum
  4. usd_inr_volatility: 20-day rolling volatility
  5. inr_weakness_score: Weighted composite (1d Γ— 40% + 5d Γ— 30% + momentum Γ— 30%)

Why This Matters:

  • INR weakening (USD/INR ↑) β†’ FII selling β†’ Market downturn
  • INR strengthening (USD/INR ↓) β†’ FII buying β†’ Market rally
  • Real-time macro signal that professional traders watch

πŸ’‘ What Makes This Different?

Previous Models

  • 51 features (technical + sentiment + advanced signals)
  • Missed critical macro indicators
  • No FII sentiment integration

Current Models (126 Features)

  • Macro-aware: USD/INR forex as leading indicator
  • Market-correlated: Nifty Bank 8x weightage
  • Sentiment-enhanced: 2x weight on FinBERT + Advanced
  • Optimized: Reduced from 248 β†’ 126 features to prevent overfitting
  • Result: 100% accuracy with 84.08% confidence (+15.13% vs previous)

πŸ“₯ Usage

from huggingface_hub import hf_hub_download
import tensorflow as tf

# Download a specific model
model_path = hf_hub_download(
    repo_id="RohithKoripelli/indian-bank-stock-models-advanced",
    filename="HDFCBANK/best_model.keras"
)

# Load the model
model = tf.keras.models.load_model(model_path)

# Download scaler
scaler_path = hf_hub_download(
    repo_id="RohithKoripelli/indian-bank-stock-models-advanced",
    filename="HDFCBANK/scaler.pkl"
)

πŸ“Š Training Data

  • Date Range: January 2019 - January 2026
  • Records: ~1,544 per stock (after cleaning)
  • Features: 126 (35 technical + 4 FinBERT + 12 advanced + 3 Nifty + 7 USD/INR + duplicates)
  • News Articles: 963 articles analyzed
  • Forex Data: 1,837 days of USD/INR rates
  • Market Index: Nifty Bank daily returns
  • Training Split: 70% train, 15% validation, 15% test

Data Sources:

  • Stock Prices: Yahoo Finance (NSE)
  • News: Google News API (30-day lookback)
  • Sentiment: FinBERT (yiyanghkust/finbert-tone)
  • Advanced Signals: Custom NLP extraction from headlines
  • Forex: USD/INR rates from Yahoo Finance
  • Market Index: Nifty Bank (^NSEBANK)

πŸ€– Automation

These models are used in an automated GitHub Actions workflow that:

  1. Collects latest stock data daily
  2. Calculates technical indicators
  3. Collects Nifty Bank index data
  4. Collects USD/INR forex rates (NEW)
  5. Fetches news articles via GNews API
  6. Analyzes sentiment with FinBERT
  7. Extracts advanced trading signals
  8. Prepares 126 features with optimized weights
  9. Downloads models from Hugging Face
  10. Generates predictions with confidence scores
  11. Deploys to Vercel

Scheduled: Daily at 10 PM IST (4:30 PM UTC)

πŸ”¬ Training Details

  • Epochs: 21-61 (early stopping with patience 20)
  • Batch Size: 32
  • Learning Rate: 0.0001 with ReduceLROnPlateau
  • Optimizer: Adam with gradient clipping
  • Loss: Binary cross-entropy (direction) + Huber (magnitude)
  • Training Time: ~7 minutes total for all 8 stocks
  • Trained: January 23, 2026

πŸ“œ License

MIT License - Free to use for research and educational purposes.

πŸ”— Links

πŸ“ Citation

If you use these models in your research, please cite:

@misc{indian-bank-advanced-models-2026,
  author = {Koripelli, Rohith},
  title = {Indian Bank Stock Price Prediction Models with Advanced Signals},
  year = {2026},
  publisher = {Hugging Face},
  howpublished = {\url{https://huggingface.co/RohithKoripelli/indian-bank-stock-models-advanced}}
}

Last Updated: January 2026 Model Version: V5 Transformer with Advanced Signals Status: Production Ready βœ“

Downloads last month
253
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support