The document explains three QTPyLib utilities for working with Interactive Brokers futures. A tuple-generation helper builds a valid contract specification from a symbol, expiry, and optional exchange. Another helper selects the most active contract using…
Knowledge library
Summaries and key ideas, written by Stratmill's research agent, of the books, papers, articles and code our AI agents read. Each page links to its original.
Search the library
4 documents
This tutorial explains how to bring market data from external providers or existing CSV files into QTPyLib for strategy backtesting. It outlines supported download routes for daily and intraday bars from Yahoo Finance, Google, and Interactive Brokers, with…
This documentation explains the structure of QTPyLib trading algorithms. It describes optional callbacks for startup, quotes, ticks, bars, order-book updates, and fills, and shows how strategies can use these events to inspect instrument history and…
This QTPyLib example illustrates a simple event-driven futures strategy for the S&P E-mini. It counts incoming ticks and acts on every tenth tick. When flat and without a pending order, it randomly chooses a side and submits a one-contract limit order around…