A Python automation project for collecting financial market data, formatting it in Persian, and publishing scheduled market updates to a Telegram channel.
Financial Markets Radar Bot is a long-running Python script that monitors selected financial market data sources and sends formatted updates to Telegram.
The project focuses on Iran-related financial market monitoring, including USD/IRR, USDT/IRR, major currencies, gold, coins, crypto, global gold and silver, and energy prices.
The goal of this project is to automate repetitive market reporting and create clean, readable Telegram posts using live market data.
- Collects live financial market data from public web/API sources
- Parses USD/IRR-related messages from a public Telegram web page
- Tracks selected crypto prices such as BTC, ETH, BNB, SOL, XRP, DOGE, TRX, TON, and ADA
- Generates Persian-formatted Telegram messages
- Converts English digits to Persian digits
- Handles Jalali date formatting
- Uses Tehran timezone logic
- Uses Iran holiday data to control market-day posting logic
- Sends automated market updates to a Telegram channel
- Keeps Telegram credentials outside the code using environment variables
The bot currently supports message generation for:
- USD/IRR and USDT/IRR
- Major international currencies
- Domestic gold and silver
- Gold coins
- Global gold and silver
- Crypto assets
- Global energy prices
Some additional message types, such as gold funds and Iran stock market indexes, are partially prepared in the code and can be activated or expanded later.
- Python
- pandas
- requests
- BeautifulSoup
- jdatetime
- pytz
- python-dotenv
- Telegram Bot API
FinancialMarketsRadarBot.py Main automation script
IranHolidays.pkl Iran holiday data used by the scheduler
requirements.txt Python dependencies
.env.example Example environment variables
.gitignore Files excluded from Git tracking
README.md Project documentation
Clone the repository:
git clone https://github.com/YOUR-USERNAME/MarketsRadarBot.git
cd MarketsRadarBotCreate and activate a virtual environment:
python -m venv .venvOn Windows:
.venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtCreate a .env file based on .env.example:
TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here
TELEGRAM_MAIN_CHAT_ID=your_main_channel_or_chat_id_here
TELEGRAM_TEST_CHAT_ID=your_test_channel_or_chat_id_here
USE_VPN=true
TELEGRAM_BYPASS_URL=https://www.httpdebugger.com/Tools/ViewHttpHeaders.aspxRun the bot:
python FinancialMarketsRadarBot.py| Variable | Description |
|---|---|
TELEGRAM_BOT_TOKEN |
Telegram bot token used for sending messages |
TELEGRAM_MAIN_CHAT_ID |
Main Telegram channel or chat ID |
TELEGRAM_TEST_CHAT_ID |
Test Telegram channel or chat ID |
USE_VPN |
If true, sends messages directly through Telegram API |
TELEGRAM_BYPASS_URL |
Optional bypass URL for restricted internet environments |
TELEGRAM_SOURCE_CHANNEL |
Public Telegram source channel used for parsing USD/IRR messages |
PUBLIC_CHANNEL_HANDLE |
Public channel handle shown at the bottom of generated messages |
This repository does not include real Telegram bot tokens, private chat IDs, .env files, local configuration files, virtual environments, browser drivers, IDE files, logs, or session files.
Secrets should be stored locally in a .env file and should never be committed to GitHub.
If USE_VPN=false, the script may send the Telegram API request through the configured bypass service. Use this only when necessary and only with services you trust.
This script is designed as a long-running automation process. It uses an infinite loop and checks market conditions on a schedule.
Some data sources may change their structure or availability over time. If a source changes, the related parser or API request may need to be updated.
This project is for educational and portfolio purposes only. The generated messages are not financial advice. Users are responsible for respecting the terms of service and usage policies of any data sources they access.