{"repo":"NadirAliOfficial/IBKR-Webhook-to-Order-Bot","free":true,"listed":false,"github":"https://github.com/NadirAliOfficial/IBKR-Webhook-to-Order-Bot","clone":"git clone https://github.com/NadirAliOfficial/IBKR-Webhook-to-Order-Bot.git","description":"- Connects to IB Gateway / TWS via ib_insync - Enforces “one trade at a time” per symbol (no pyramiding) - Reverses position on opposite-side open signals - Attaches a TP limit order when provided - Closes existing position on “close” signals","language":"Python","stars":13,"topics":["algorithmic-trading","automation","ibkr","interactive-brokers","python","trading-bot","webhook"],"license":"MIT","category":"trading","readme_excerpt":"IBKR Webhook-to-Order Bot A stateful Flask-based trading bot that receives webhook signals (from TradingView or any alert source) and executes real-time orders on Interactive Brokers using ib insync . Maintains a full trade journal in SQLite, supports TP/SL order management, and exposes a live dashboard and REST API. --- How It Works --- Features - Webhook-triggered execution — POST to /webhook to open or close positions - Webhook authentication — WEBHOOK SECRET env var; requests without matching X-Webhook-Secret header are rejected (401) - Stateful trade journal — SQLite tracks entry/exit prices, TP hit, SL, order IDs, and close reason - Smart re-entry blocking — if last trade closed via TP, same-direction signal is blocked until manually reset - Position reversal — opposite signal on an open trade auto-closes and reverses - TP + SL order placement — both limit orders placed alongside market entry - TP cancel on close — open TP order is cancelled before placing the closing market order - Live dashboard — Flask UI at / shows account data, open positions, and trade log - Health endpoint — GET /health returns IBKR connection status and uptime (JSON) - Trades API — GET /api/trades returns paginated trade journal as JSON - Input validation — webhook payload validated before any order is placed (400 on bad input) --- Setup 1. Install dependencies 2. Configure environment 3. Start TWS or IB Gateway Make sure TWS or IB Gateway is running with API access enabled: - TWS Live: port 749","default_branch":null,"files":null,"tree":[],"storefront":"/r/NadirAliOfficial","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/NadirAliOfficial/IBKR-Webhook-to-Order-Bot/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}