ib-insync

Implements Interactive Brokers trading logic using the ib_insync library.

1|Updated May 20, 2026
One-click install
npx skills add https://github.com/daisyzhang2024/AgenticQuantSystem --skill ib-insync
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: ib-insync
Source: https://github.com/daisyzhang2024/AgenticQuantSystem/tree/main/course/08_production_hardening/.claude/skills/ib-insync
Command: npx skills add https://github.com/daisyzhang2024/AgenticQuantSystem --skill ib-insync

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires ib_insync, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill enables the implementation of Interactive Brokers trading logic using ib_insync, simplifying the integration of trading strategies into Python applications.

Core Features & Use Cases

  • Interactive Brokers API: Offers a high-level interface to Interactive Brokers' TWS API.
  • Connection Management: Handles connections to TWS or IB Gateway, including timeouts and error handling.
  • Data Fetching: Provides methods for fetching historical data, live market data, and account information.
  • Order Management: Supports placing, modifying, and canceling orders, including market, limit, stop, and bracket orders.
  • Use Case: Build a trading bot that connects to Interactive Brokers, fetches market data, and places orders based on predefined rules.

Quick Start

Connect to Interactive Brokers using ib-insync by running ib.connect("127.0.0.1", 7497, clientId=1). To place an order, use ib.placeOrder(contract, order).

Frequently Asked Questions about ib-insync

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I connect my Python trading bot to Interactive Brokers using ib_insync?▼

You can connect your Python trading bot to Interactive Brokers by establishing a connection to TWS or IB Gateway using ib.connect() with your local IP, port, and client ID. This handles timeouts and API connection errors.

Can I fetch historical and live market data from Interactive Brokers in Python?▼

Yes, you can fetch historical data, live market data, and account information from Interactive Brokers in Python. The Skill provides dedicated methods to retrieve real-time market data streams for trading strategies.

How do I place and manage orders with Interactive Brokers API in Python?▼

You can place and manage orders with Interactive Brokers API using ib.placeOrder(contract, order). The Skill supports placing, modifying, and canceling market, limit, stop, and bracket orders.

Do I need TWS or IB Gateway running to use ib_insync for trading logic?▼

Yes, you need either TWS or IB Gateway running to use ib_insync for trading logic. The Skill manages connections to these Interactive Brokers platforms to execute Python-based trading strategies.

What is the best way to automate Interactive Brokers trading strategies in Python?▼

The best way to automate Interactive Brokers trading strategies in Python is using a high-level interface like ib_insync. It simplifies API integration to fetch market data and execute predefined trading rules.