Harwinder de96af798c Add chart generation: /chart command + /signal sends chart
- charts.py: candlestick (mplfinance, dark theme) with EMA20/50
  overlay, Bollinger Bands, RSI subplot and 30/70 reference lines
- /signal now sends chart image with analysis as caption
- New /chart <PAIR> <TF> command for standalone chart view

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-01 16:54:56 -04:00

Forex Indicator Telegram Bot

Minimal Telegram bot that serves forex prices and technical indicators (RSI, MACD, Bollinger Bands) on demand, powered by Twelve Data.

Get tokens

  1. Telegram bot token — message @BotFather, /newbot, copy the token.
  2. Twelve Data API key — sign up at twelvedata.com, free tier gives 800 req/day, 8 req/min.

Install

cd forex_bot
python -m venv .venv
# Windows: .venv\Scripts\activate    macOS/Linux: source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env   # then edit .env and paste your tokens

pandas-ta requires NumPy 1.x; the pinned numpy==1.26.4 handles that.

Run

python main.py

Then open Telegram and message your bot.

Commands

Command Example Description
/start, /help /help Welcome + command list
/pairs /pairs List supported pairs and timeframes
/price <PAIR> /price EURUSD Latest close price
/rsi <PAIR> <TF> /rsi EURUSD 1h RSI(14)
/macd <PAIR> <TF> /macd GBPUSD 4h MACD(12,26,9)
/bb <PAIR> <TF> /bb USDJPY 1day Bollinger Bands(20,2) + price

Supported pairs: EURUSD, GBPUSD, USDJPY, AUDUSD, USDCAD Supported timeframes: 15min, 1h, 4h, 1day

Notes

  • In-memory cache per (pair, timeframe) with TTL based on timeframe — keeps you well under the free-tier rate limit.
  • Simple in-process rate limiter caps to 8 calls/min.
  • No database, no scheduler, no charts — on-demand text only.

Educational only. Not financial advice.

S
Description
No description provided
Readme 45 KiB
Languages
Python 100%