A Python-based Telegram bot that monitors large-cap stocks for significant drops in their hourly Relative Strength Index (RSI). Designed to help identify potential buying opportunities by sending real-time alerts and technical charts through Telegram.
⚠️ Important: This tool does not run continuously or on a schedule — it responds to user commands that trigger checks on hourly data.
The Relative Strength Index (RSI) is a momentum oscillator that measures the speed and change of price movements. Values range from 0 to 100:
- RSI > 70: Stock might be overbought
- RSI < 30: Stock might be oversold
This bot notifies you when:
- The current hourly RSI drops below 30, OR
- RSI falls by more than 25 points compared to the previous hour
These signals might indicate oversold conditions and — if confirmed by other indicators — could represent a buying opportunity.
- Multi-Market Support: Monitors tickers from NASDAQ-100, S&P 500, CAC 40, and DAX
- Technical Analysis: Uses
yfinanceandtalibraries for comprehensive analysis - Telegram Alerts: Sends notifications with:
- 📊 4-panel technical chart (Candlestick, OBV, MACD, RSI)
- 📰 Recent news headlines about the stock
- Command-Based Interface: Responds to specific Telegram commands for different markets
/rsi_nasdaq– Check RSI for NASDAQ-100 stocks/rsi_sp500– Check RSI for S&P 500 stocks/rsi_cac– Check RSI for CAC 40 stocks/rsi_dax– Check RSI for DAX stocks/rsi_all– Check RSI for all markets combined
git clone https://github.com/sgazagnes/rsi-alert-bot.git
cd rsi-alert-botpip install -r requirements.txt- Open @BotFather on Telegram
- Send
/newbotand follow the prompts - Save the bot token provided
- Start a conversation with your bot
- Visit:
https://api.telegram.org/bot<YOUR_BOT_TOKEN>/getUpdates - Look for
"chat":{"id":...}in the response — that's your chat ID
Create the .env file:
cp .env.example .envEdit .env with your credentials:
BOT_TOKEN=your_bot_token_here
CHAT_ID=your_chat_id_herepython rsi_bot.pyThe bot will start polling Telegram for messages and respond to your commands.
rsi-alert-bot/
├── rsi_bot.py # Main bot logic and handlers
├── .env.example # Template for environment variables
├── .env # Your actual environment variables (not in git)
├── ticker_lists/ # Market-specific ticker lists
│ ├── nasdaq100_tickers.txt
│ ├── sp500_tickers.txt
│ ├── cac40_tickers.txt
│ └── dax_tickers.txt
├── temp_plots/ # Temporary storage for generated charts
├── requirements.txt # Python dependencies
├── README.md # This file
└── .gitignore # Git ignore rules
The bot relies on these Python packages:
python-telegram-bot- Telegram API wrapperyfinance- Financial data from Yahoo Financeta- Technical analysis indicatorsmatplotlib- Chart generationpandas- Data manipulationpython-dotenv- Environment variable management
- Manual Operation: The bot responds to commands rather than running automatically
- Data Source: RSI is computed using hourly candles
- Chart Storage: Generated charts are temporarily stored in
temp_plots/folder
To run the bot on a schedule, consider:
- Cron Jobs (Linux/macOS)
- Task Scheduler (Windows)
- Cloud Functions (AWS Lambda, Google Cloud Functions)
- GitHub Actions with scheduled workflows
- RSI Period: 14 periods (standard)
- Timeframe: 1-hour candles
- Lookback: Past 30 days of data
- Alert Thresholds:
- RSI below 30 (oversold)
- RSI drop of 25+ points from previous hour
- Not Financial Advice: This tool is for informational purposes only
- No Guarantees: RSI-based strategies are analytical tools, not investment guarantees
- Risk Warning: All trading and investing involves risk of loss
- Due Diligence: Always consider technical, fundamental, and personal factors before making investment decisions
- Use at Your Own Risk: The author is not responsible for any financial losses
- Bot not responding: Check your bot token and chat ID
- No data for ticker: Verify ticker symbols in your lists
- Chart generation fails: Ensure
temp_plots/directory exists - Rate limiting: Yahoo Finance may limit requests; add delays if needed
If you encounter issues:
- Check the console output for error messages
- Verify all environment variables are set correctly
- Ensure ticker files contain valid symbols
- Test with a single command first (e.g.,
/rsi_nasdaq)
This project is open source.
Contributions are welcome!
Happy trading! 📈