📈 IBKR Automated Trading Architecture A fully autonomous, modular Python algorithmic trading engine designed for Interactive Brokers (TWS / Gateway).
Built for stability, risk management, and complete transparency, this system executes trades without human emotion. It features dynamic position sizing, automated trailing stops, live Telegram telemetry, and a fail-safe auto-healing Watchdog.
🚀 Core Modules
- The Strategy Engine (Smart Buyer)
- Macro Trend Filtering: Executes trades only when the asset is mathematically confirmed to be in a macro uptrend using custom moving average thresholds.
- Precision Entries: Triggers market orders exclusively on highly specific, data-driven oversold conditions using momentum oscillators.
- Dynamic Position Sizing: Automatically adjusts capital allocation based on signal conviction (scales up position size dynamically when technical conditions reach extreme algorithmic thresholds).
Dynamic Position Sizing: Automatically adjusts capital allocation based on signal conviction (scales up position size when conditions are extreme).
- The Security Director (Risk Management) Dynamic Trailing Stops: Continuously tracks live price peaks and automatically adjusts the stop-loss to lock in secured profits.
Automated Liquidation: Sells positions immediately when the trailing stop threshold is breached, ensuring consistent profit-taking.
- 🗃️ The "Black Box" Trade Recorder Immutable Audit Trail: Every API request, market tick, sizing calculation, and execution is meticulously recorded locally.
Complete Transparency: Never guess why a trade was triggered or skipped. The Black Box provides full data history for post-trade analysis, debugging, and strategy optimization.
- The Watchdog (Auto-Healing System) Connection Resilience: Actively monitors the IBKR Gateway/TWS connection with a continuous keep-alive heartbeat.
Automatic Reconnection: Safely manages disconnects and handles error loops to ensure the bot remains operational without manual intervention.
- Telegram Telemetry Live Push Notifications: Receive instant alerts directly on your phone.
Detailed Trade Data: Get real-time updates for Order Sent, Order Executed (including IBKR fees), Trailing Stop Armed, and Final Net Profit.
🛠️ Technical Specifications Language: Python 3.9+
Broker Interface: Interactive Brokers via ib_insync
Connectivity: Supports both Paper Trading (Port 7497) and Live Accounts (Port 7496)
Supported Assets: Equities, Leveraged ETFs and Crypto
Security: Strict decoupling of sensitive data (API keys, Telegram tokens) via isolated configuration files.
Setup & Installation Please refer to the requirements.txt file for dependencies and config.example.py to securely set up your broker and Telegram credentials.
Ready to deploy your own algorithmic trading engine? You can purchase the complete, ready-to-run source code (including setup instructions and the exact strategy logic) on any of the platforms below:
- [🛍️ Gumroad - Instant Download. https://guigui03.gumroad.com/l/llehlzt
- [🟢 Fiverr - Buy with Setup Support. https://www.fiverr.com/s/WeZ8BmQ
- [💼 Upwork - Hire me for Custom Integrations. https://www.upwork.com/services/product/development-it-a-python-ibkr-automated-trading-bot-with-telegram-dashboard-2091343830985363588?ref=project_share