Independent project2026
NIFTY 50 Drawdown Alert System
A monitoring service that tracks the NIFTY 50 index and sends an alert when it falls set percentages below its rolling 52-week high.
- Python
- yfinance
- SQLite
- Docker
- Telegram Bot API
- pytest
View code for NIFTY 50 Drawdown Alert System on GitHub (opens in a new tab)
- Problem
- Market drawdowns build up over days or weeks, and checking an index by hand makes it easy to miss the moment a decline crosses a level that matters.
- Objective
- Watch the NIFTY 50 during market hours and send one alert per drawdown threshold by Telegram or email, without ever touching a trading account.
Read case study
- My contribution
- Designed and built the data pipeline, alert logic, notifications and deployment setup.
- Approach
- Prices come from yfinance through a pluggable data provider and are validated before use.
- The service computes the drawdown from the rolling 52-week high and checks it against thresholds of 10% to 50% in 5-point steps (configurable).
- Alerts go out through Telegram and SMTP email, with SMS and push left as stubs for a provider to plug in.
- It runs as a systemd service, a cron job, or two Docker Compose containers: the monitor and a Telegram assistant that answers status questions.
- Key technical decisions
- Each threshold fires once and only re-arms after the drawdown recovers within a 2% buffer, so small swings don't repeat alerts.
- Alert state is stored in SQLite, so a restart never resends an alert.
- Polling is gated by market hours, weekends and an exchange-holiday file, and stale prices are rejected.
- Monitoring only: the system has no broker or demat access by design.