All projects

Trading & bots · April 2026

Bybit fractal & FVG scanner bot — Telegram signals (Python)

Bybit fractal & FVG scanner bot — Telegram signals (Python)

An automated bot for the Bybit exchange that finds trade setups based on fractal and Fair Value Gap (FVG) patterns and sends signals to Telegram. The bot scans all USDT perpetuals, finds three-candle down fractals on a higher timeframe, monitors their sweeps in real time over WebSocket, then looks for a bullish FVG on a lower timeframe. It only reads market data — it does not trade.

What was built:

  • Fractal scanner: filtering coins by 24h turnover (>= 150k USDT), loading candles, detecting three-candle down fractals, dedup and throttling under rate limits
  • Real-time monitoring: a pool of WebSocket connections (<=200 subscriptions each), fractal-sweep detection, auto-reconnect with exponential backoff
  • FVG detector: bullish Fair Value Gap over three candles (Low3 > High1) with gap-zone calculation
  • State Manager (FSM): fractal lifecycle active -> waiting_for_fvg -> sent / lost / expired, bounded FVG wait (21 or 60 days), auto-cleanup after 30 days
  • Telegram notifications with dedup; APScheduler (cron) scheduling
  • Two modes: D1+H4 and 1W+D1; SQLite in WAL mode with a unique index and transactions
  • Resilience: retry on 429 and SQLite locked, skip failing coin, restore states from DB on restart; test coverage (pytest)

Stack: Python 3.10+, pybit (Bybit REST + WebSocket v5), SQLite (WAL), APScheduler, websockets, requests, pytest.

Role: end-to-end design and development of the bot (backend, Python).

  • Bybit fractal & FVG scanner bot — Telegram signals (Python) — Screen 1
    Screen 1
  • Bybit fractal & FVG scanner bot — Telegram signals (Python) — Screen 2
    Screen 2
  • Bybit fractal & FVG scanner bot — Telegram signals (Python) — Screen 3
    Screen 3
  • Bybit fractal & FVG scanner bot — Telegram signals (Python) — Screen 4
    Screen 4