How to use IBPy Python with Interactive Brokers TWS API For Automated Trading

This tutorial covers how to use the IBPy Python programming module with Interactive Broker's Trader Workstation API (TWS API). We assume that Python is already installed on your machine. If not, head over to: and download Python 2.7!

The API is intended for Java, though the IBPy module is a Python wrapper around the Java API which allows us to use Python.

This tutorial will teach you how to actually execute an order through the TWS API. We cover installation of IBPy as well as TWS. We also show what settings you need to modify in TWS to allow for automated trading. From here, we cover how to execute both a market order for stocks as well as a limit order.

I hope you enjoy, if you have any questions or comments, please leave them below, donations: 1GV7srgR4NJx4vrk7avCmmVQQrqmv87ty6