Made byBobr AI

LSTM Stock Forecasting: NSE Banking Anomaly & Risk Analysis

Learn how LSTM networks and Autoencoders are used for stock price prediction, anomaly detection, and Sharpe ratio risk analysis on NSE banking stocks.

#stock-forecasting#lstm#nse-india#deep-learning#anomaly-detection#fintech#risk-analysis#banking-sector
Watch
Pitch

Leveraging Long Short-Term Memory (LSTM) for Stock Prediction, Anomaly Detection, and Risk Analysis in the Indian Banking Sector

Stock Price Forecasting · Anomaly Detection · Risk Analysis

Prem Kumar N · Ronada Sakalesha · Rakesh MA · Rahul K

Dept. of Computer Science and Engineering, Dayananda Sagar University, Bengaluru, India

LSTM Neural Networks NSE India Sharpe Ratio Time Series
Targeted Entities
Made byBobr AI

Agenda / Overview

01

Introduction & Motivation

Background, problem statement, and objectives

02

Literature Review

Existing forecasting models and their limitations

03

Methodology

LSTM architecture, data preprocessing, and model design

04

Results & Discussion

Model evaluation, predictions vs. actual data

05

Risk Analysis

Sharpe ratio evaluation and anomaly detection metrics

06

Conclusion & Future Work

Summary of findings and potential enhancements

Made byBobr AI

Introduction & Motivation

Critical Component of NSE

Indian banking sector is a critical component of the National Stock Exchange (NSE).

Growth Demands Better Tools

Rapid growth of fintech and retail investor participation necessitates advanced forecasting tools.

Limitations of Traditional Models

Traditional models like ARIMA and GARCH fail to capture nonlinear dynamics and long-term temporal dependencies.

The Power of LSTM Networks

LSTM networks overcome the vanishing gradient problem and excel in forecasting complex financial time series.

Targeted Focus
(Major Banks 2021–2026)
Key Goal: Predict price movements, detect anomalies, and assess risk using LSTM.
Made byBobr AI

Literature Review

Key Studies

Fischer & Krauss (2018)
LSTM outperforms classic models on S&P 500
Selvin et al. (2017)
Confirmed LSTM superiority using NSE data
Malhotra et al. (2016)
LSTM autoencoders detect anomalies via reconstruction error (unsupervised)

LSTM Architecture: Gate Equations

Input Gate
iₜ = σ(Wᵢ·hₜ₋₁ + Uᵢ·Xₜ + bᵢ)
Forget Gate
fₜ = σ(Wf·hₜ₋₁ + Uf·Xₜ + bf)
Output Gate
oₜ = σ(Wo·hₜ₋₁ + Uo·Xₜ + bo)
Cell State
cₜ = tanh(W·hₜ₋₁ + U·Xₜ + b)
W = recurrent weight
U = input-to-hidden weights
cₜ = candidate cell state
Made byBobr AI

Methodology

Data Pipeline
NSE Data Collection
Preprocessing
LSTM Model
Anomaly Detection
Risk Metrics
OHLCV data: SBI, HDFC, ICICI | Jan 2021 – Mar 2026 | ~1,241 trading days
Preprocessing: forward-fill, MinMaxScaler [0,1] on training data only, 60-day sliding window
Train/Test split: 80:20 chronological (no look-ahead bias)

LSTM Architecture

3 stacked LSTM layers (128 → 64 → 32 units)
Dropout(0.2), Dense(1)
Adam optimizer (lr=0.001), MSE loss, early stopping patience=10

Anomaly Detection

LSTM Autoencoder, Encoder LSTM (64 units)
Trained on normal data only
Threshold = 95th percentile of reconstruction errors
Made byBobr AI

Historical Price Trends (2021–2026)

SBI Bank
Long-Term Uptrend
2021 ₹400 ₹1200+
  • Price rose from ~INR 400 (2021) to INR 1200+ (early 2026)
  • Parabolic surge in Jan-Feb 2026
  • Consistent long-term uptrend
HDFC Bank
Structural Correction
₹2000 Aug '25 ₹1000
  • Rose to INR 2000 then sharp structural correction in August 2025 (-50%)
  • Post-crash consolidation at
    INR 950–1000
ICICI Bank
Compounding Growth
2021 ₹600 ₹1440 ₹1500
  • Most consistent compounding growth: INR 600 → INR 1500
  • Mid-2025 reversal around
    INR 1440–1460
Inter-Stock Correlation
SBI ICICI = 0.94 (strong)
HDFC SBI = -0.13 (decorrelated due to Aug 2025 anomaly)
Made byBobr AI

Model Training & Convergence

Training Progress 13 / 50 Epochs
  • Converged in just 13 epochs
  • Final training MSE: 0.002
  • Fast convergence, efficient
Training Progress 50 / 50 Epochs
  • Required all 50 epochs
  • Validation loss < 0.015 at end
  • Challenged by Aug 2025 structural break
Best Performer
Training Progress Consistent
  • Most consistent convergence
  • Lowest final loss values
  • Supports best MAPE performance
Evaluation Metrics: MSE | MAE | MAPE Lower values = Higher predictive accuracy
Made byBobr AI

Stock Price Prediction Results

Stock MAE (INR) MSE MAPE (%)
SBI 1.85 4.82 2.31
HDFC 2.43 6.14 2.08
ICICI 1.62 2.97 1.86
Key Observations
ICICI Bank: Best MAPE of 1.86% — most predictable stock
HDFC Bank: Higher error due to unprecedented Aug 2025 structural break
SBI Bank: Good accuracy but lagged in Jan-Feb 2026 parabolic surge (predicted INR 1050 vs actual INR 1220)
All three models are commercially viable in terms of predictive accuracy
Made byBobr AI

Anomaly Detection Results

SBI Anomalies
Clustered in early-2026 parabolic surge
Price range: INR 1000–1200
Reflects unusual upward acceleration
HDFC Anomalies
Detected during post-crash consolidation
Price range: INR 950–1000
Following sharp -50% correction in August 2025
Most impactful anomalous event: structural break Aug 2025
ICICI Anomalies
Mid-2025 reversal zone
Price range: INR 1440–1460
Moderate anomaly cluster
Zero false positives detected during normal trading period 2021–2024
LSTM Autoencoder Threshold
95th percentile of reconstruction error distribution
Made byBobr AI

Risk Analysis Summary

Bank Ann. Return Ann. Volatility Sharpe Ratio
SBI 18.5% 23.2% 0.80 ★
HDFC 14.2% 22.8% 0.34
ICICI 15.8% 21.1% ★ 0.44
Growth Seekers: SBI
Best risk-adjusted returns, Sharpe Ratio 0.80
Risk-Averse Investors: ICICI
Lowest volatility 21.1%, stable growth
Caution: HDFC
Post-correction consolidation, Sharpe 0.34
SBI + ICICI Diversification = Optimal Portfolio (correlation 0.94, complementary risk exposures)
Risk-free rate used: 6.5% | 252 trading days per annum
Made byBobr AI

Conclusion

Multi-layer LSTM is commercially viable — ICICI MAPE of 1.86% proves accuracy
LSTM Autoencoder captures real market events (HDFC Aug 2025 crash, SBI Jan 2026 surge)
SBI = Best risk-adjusted asset (Sharpe Ratio 0.80)
ICICI = Most stable investment (lowest volatility 21.1%)
SBI + ICICI diversification offers optimal growth-stability tradeoff

Future Work

Integrate Transformer architectures
Expand to full NIFTY Bank Index (12 stocks)
Add NLP-based news sentiment analysis
Implement live NSE data feed system
Made byBobr AI

Thank You

This research was conducted at the Dept. of Computer Science and Engineering, Dayananda Sagar University, Bengaluru, India

Prem Kumar N · Ronada Sakalesha · Rakesh MA · Rahul K

prem.kumar@dsu.edu.in | ronada.s@dsu.edu.in | rakesh.ma@dsu.edu.in | rahul.k@dsu.edu.in

Key References
[1] Hochreiter & Schmidhuber (1997) — LSTM, Neural Computation
[4] Malhotra et al. (2016) — LSTM encoder-decoder anomaly detection, ICML
[2] Fischer & Krauss (2018) — Deep learning for financial predictions, EJOR
[6] Sharpe (1966) — Mutual fund performance, Journal of Business
[3] Selvin et al. (2017) — Stock prediction LSTM/RNN/CNN, IEEE ICACCI
[7] Abadi et al. — TensorFlow, USENIX OSDI
LSTM NSE India Stock Prediction Anomaly Detection Sharpe Ratio Indian Banking
Made byBobr AI
Bobr AI

DESIGNER-MADE
PRESENTATION,
GENERATED FROM
YOUR PROMPT

Create your own professional slide deck with real images, data charts, and unique design in under a minute.

Generate For Free

LSTM Stock Forecasting: NSE Banking Anomaly & Risk Analysis

Learn how LSTM networks and Autoencoders are used for stock price prediction, anomaly detection, and Sharpe ratio risk analysis on NSE banking stocks.

Leveraging Long Short-Term Memory (LSTM) for Stock Prediction, Anomaly Detection, and Risk Analysis in the Indian Banking Sector

Stock Price Forecasting · Anomaly Detection · Risk Analysis

Prem Kumar N · Ronada Sakalesha · Rakesh MA · Rahul K

Dept. of Computer Science and Engineering, Dayananda Sagar University, Bengaluru, India

Agenda / Overview

Introduction & Motivation

Background, problem statement, and objectives

Literature Review

Existing forecasting models and their limitations

Methodology

LSTM architecture, data preprocessing, and model design

Results & Discussion

Model evaluation, predictions vs. actual data

Risk Analysis

Sharpe ratio evaluation and anomaly detection metrics

Conclusion & Future Work

Summary of findings and potential enhancements

Introduction & Motivation

Critical Component of NSE

Indian banking sector is a critical component of the National Stock Exchange (NSE).

Growth Demands Better Tools

Rapid growth of fintech and retail investor participation necessitates advanced forecasting tools.

Limitations of Traditional Models

Traditional models like ARIMA and GARCH fail to capture nonlinear dynamics and long-term temporal dependencies.

The Power of LSTM Networks

LSTM networks overcome the vanishing gradient problem and excel in forecasting complex financial time series.

Predict price movements, detect anomalies, and assess risk using LSTM.

Literature Review

Fischer & Krauss (2018)

LSTM outperforms classic models on S&P 500

Selvin et al. (2017)

Confirmed LSTM superiority using NSE data

Malhotra et al. (2016)

LSTM autoencoders detect anomalies via reconstruction error (unsupervised)

iₜ = σ(Wᵢ·hₜ₋₁ + Uᵢ·Xₜ + bᵢ)

fₜ = σ(Wf·hₜ₋₁ + Uf·Xₜ + bf)

oₜ = σ(Wo·hₜ₋₁ + Uo·Xₜ + bo)

cₜ = tanh(W·hₜ₋₁ + U·Xₜ + b)

W = recurrent weight

U = input-to-hidden weights

cₜ = candidate cell state

Methodology

Data Pipeline

NSE Data Collection

Preprocessing

LSTM Model

Anomaly Detection

Risk Metrics

OHLCV data: SBI, HDFC, ICICI | Jan 2021 – Mar 2026 | ~1,241 trading days

Preprocessing: forward-fill, MinMaxScaler [0,1] on training data only, 60-day sliding window

Train/Test split: 80:20 chronological (no look-ahead bias)

LSTM Architecture

3 stacked LSTM layers (128 → 64 → 32 units)

Dropout(0.2), Dense(1)

Adam optimizer (lr=0.001), MSE loss, early stopping patience=10

Anomaly Detection

LSTM Autoencoder, Encoder LSTM (64 units)

Trained on normal data only

Threshold = 95th percentile of reconstruction errors

Historical Price Trends (2021–2026)

Stock Price Prediction Results

Stock

MAE (INR)

MSE

MAPE (%)

Best MAPE of 1.86% — most predictable stock

Higher error due to unprecedented Aug 2025 structural break

Good accuracy but lagged in Jan-Feb 2026 parabolic surge (predicted INR 1050 vs actual INR 1220)

All three models are commercially viable in terms of predictive accuracy

Anomaly Detection Results

SBI Anomalies

Clustered in early-2026 parabolic surge

INR 1000–1200

Reflects unusual upward acceleration

HDFC Anomalies

Detected during post-crash consolidation

INR 950–1000

Following sharp -50% correction in August 2025

Most impactful anomalous event: structural break Aug 2025

ICICI Anomalies

Mid-2025 reversal zone

INR 1440–1460

Moderate anomaly cluster

Zero false positives detected during normal trading period 2021–2024

95th percentile of reconstruction error distribution

Risk Analysis Summary

Bank

Ann. Return

Ann. Volatility

Sharpe Ratio

SBI

18.5%

23.2%

0.80 ★

HDFC

14.2%

22.8%

0.34

ICICI

15.8%

21.1% ★

0.44

Growth Seekers: SBI

Best risk-adjusted returns, Sharpe Ratio 0.80

Risk-Averse Investors: ICICI

Lowest volatility 21.1%, stable growth

Caution: HDFC

Post-correction consolidation, Sharpe 0.34

SBI + ICICI Diversification = Optimal Portfolio (correlation 0.94, complementary risk exposures)

Risk-free rate used: 6.5% | 252 trading days per annum

Conclusion

Multi-layer LSTM is commercially viable

— ICICI MAPE of 1.86% proves accuracy

LSTM Autoencoder captures real market events

(HDFC Aug 2025 crash, SBI Jan 2026 surge)

SBI = Best risk-adjusted asset

(Sharpe Ratio 0.80)

ICICI = Most stable investment

(lowest volatility 21.1%)

SBI + ICICI diversification

offers optimal growth-stability tradeoff

Future Work

Integrate Transformer architectures

Expand to full NIFTY Bank Index (12 stocks)

Add NLP-based news sentiment analysis

Implement live NSE data feed system

Thank You

This research was conducted at the Dept. of Computer Science and Engineering, Dayananda Sagar University, Bengaluru, India

Prem Kumar N · Ronada Sakalesha · Rakesh MA · Rahul K

prem.kumar@dsu.edu.in | ronada.s@dsu.edu.in | rakesh.ma@dsu.edu.in | rahul.k@dsu.edu.in

Hochreiter & Schmidhuber (1997)

LSTM, Neural Computation

Fischer & Krauss (2018)

Deep learning for financial predictions, EJOR

Selvin et al. (2017)

Stock prediction LSTM/RNN/CNN, IEEE ICACCI

Malhotra et al. (2016)

LSTM encoder-decoder anomaly detection, ICML

Sharpe (1966)

Mutual fund performance, Journal of Business

Abadi et al.

TensorFlow, USENIX OSDI

  • stock-forecasting
  • lstm
  • nse-india
  • deep-learning
  • anomaly-detection
  • fintech
  • risk-analysis
  • banking-sector