Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Opening Range Breakout in Python with Interactive Brokers and ib_async

Part Time Larry via YouTube

Overview

Coursera Flash Sale
40% Off Coursera Plus for 3 Months!
Grab it
Learn to implement an opening range breakout trading strategy using Python, Interactive Brokers API, and the ib_async library in this comprehensive tutorial. Master fetching opening range bars for multiple symbols during the 9:30-9:45 AM timeframe and calculate opening ranges from historical bar data. Discover how to set up real-time monitoring coroutines and request live 5-second bar data for continuous market surveillance. Explore callback function registration for handling incoming bar data and implement logic to detect when prices cross above the opening range threshold. Build robust breakout handler functions including file logging capabilities and automated order placement functionality. Practice confirming order fills within a paper trading environment and understand important considerations for scheduling and managing execution delays. Gain practical experience with asynchronous programming patterns in financial applications while working with real market data through Interactive Brokers' trading platform.

Syllabus

0:00 Overview
0:32 Where we left off
1:25 What we’ll be adding
2:41 Where you can get the code
3:03 IBKR link that supports the channel
3:24 Fetch opening range bars for 9:30-9:45, multiple symbols
7:09 Calculating opening range from bar data
12:05 Monitor breakout coroutine
13:52 Request real-time 5 second bars
15:03 Registering an on_bar callback function
17:01 Running the monitor coroutines
18:51 Determining when price crosses above the opening range
24:39 Adding a breakout handler when a condition occurs
25:42 Handler function 1: Logging to a file
26:16 Handler function 2: Placing an order
28:23 Calling the handlers
31:06 Confirming order fills in paper trading account
31:47 Other considerations, scheduling, delays
33:34 Wrapping Up

Taught by

Part Time Larry

Reviews

Start your review of Opening Range Breakout in Python with Interactive Brokers and ib_async

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.