Real-time IBKR trading bot core engine with Benzinga news integration. Fetches live market headlines from Benzinga, scans them with Aho-Corasick keyword matching, logs results to SQLite and rotating logs, and prepares triggers for automated IBKR trading strategies.
Last updated Jul 3, 2026
14
Stars
2
Forks
0
Issues
0
Stars/day
Attention Score
52
Topics
Language breakdown
Python 100.0%
โธ Files
click to expand
README
๐ฐ IBKR News Bot
Real-time news-driven engine for algorithmic trading on IBKR โ powered by Benzinga Pro headlines. Milestone 1: Core bot for ingesting market headlines, matching keywords, and logging results to SQLite + rotating logs.
โก Features
- ๐ Benzinga Pro Integration โ Fetches real-time market headlines via API
- ๐ง Keyword Detection โ High-speed Aho-Corasick engine for matching terms
- ๐พ Persistent Logging โ Saves all matches into SQLite and rotating file logs
- ๐ฆ Modular Design โ Clean architecture ready for IBKR order routing
๐ Structure
ibkr\news\bot/
โ
โโโ ibkr\news\bot.py # main bot script
โโโ .env # API keys and config
โโโ data/news.db # SQLite database (auto-created)
โโโ logs/bot.log # Rotating log file (auto-created)
โโโ README.md
โ๏ธ Setup
1. Clone the Repository
<pre><code class="lang-bash">git clone https://github.com/NadirAliOfficial/ibkrnewsbot.git
cd ibkrnewsbot</code></pre>
2. Create Virtual Environment
python3 -m venv .venv
source .venv/bin/activate
3. Install Dependencies
pip install -r requirements.txt
(Or manually):
pip install requests python-dotenv pyahocorasick
4. Add Your API Key
Create .env:
BZAPIKEY=yourrealbenzingaapikey_here
๐ Usage
python ibkrnewsbot.py
- Pulls latest Benzinga headlines for watchlist symbols (default: AAPL, TSLA)
- Detects configured keywords (default: bankruptcy, merger, upgrade, earnings)
- Logs matches into
data/news.dbandlogs/bot.log
๐ Roadmap
โ Milestone 1 (Current)
- Core bot engine
- Benzinga news ingestion
- Keyword matcher
- SQLite + file logging
โณ Milestone 2
- Keyword-triggered orders on IBKR via
ib_insync - Bracket orders, risk controls, Telegram alerts
โณ Milestone 3
- GUI (PySide6/Qt)
- Watchlists, keyword lists, live logs
โณ Milestone 4
- VPS deployment
- Backtesting + forward testing
- Full documentation
๐ง Credits
- Benzinga Pro API
- IBKR TWS API
- Developed by @NadirAliOfficial
๐ More in this category