This document compares ways to include trading costs when optimizing portfolio or forecast weights. Options include optimizing gross returns, subtracting costs to form net returns, optimizing costs alone, penalizing costs by a multiplier, applying a maximum…
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
24 documents
This post revisits a dynamic portfolio optimizer that traded too frequently when first implemented. The author identifies shortcomings in the turnover and cost estimates, especially for sparse portfolios where many instruments have zero positions. Because…
This technical guide outlines a workflow for requesting historical prices through Interactive Brokers' API from Python using swigibpy. It describes preparing a callback object to receive data and errors, submitting a historical-data request, and waiting for…
This annual review evaluates a systematic futures portfolio over the UK tax year ending in April 2025. It separates pure futures results from cash-like ETFs and foreign-exchange effects, compares the portfolio with the SG CTA index and an AHL fund, and also…
The document describes a systematic way to select a fixed subset of futures markets for an account with limited capital. It first filters for liquidity, then estimates each instrument’s expected trading costs and the penalty from contract sizes that prevent…
The author investigates whether momentum performance and the preferred trading speed vary with instrument trading costs. Two competing ideas are considered: gross performance may be similar across instruments, leaving expensive markets less attractive after…
The document outlines a basic execution algorithm for working a buy or sell order. It begins by checking that the best quote can absorb the order, then describes joining the same side of the spread with a passive limit order. If the order remains unfilled or…
The document explains how to choose a trading frequency by comparing expected pre-cost performance with holding and execution costs. It distinguishes market-order traders, who may pay about half the spread, from traders using limit orders or execution…
The document frames a trading algorithm as a system that combines prices, order book state, auxiliary data, information from related instruments, prior positions, and parameters. These inputs may arrive at different times, so a system needs to detect when…
The document presents a static optimization approach for choosing tradable futures positions when a small account cannot hold fractional target weights. It minimizes portfolio tracking error relative to an ideal target, while also accounting for trading…
The document outlines operational decisions in an automated trading system, from calculating a target position to sending orders. It emphasizes that an apparently simple adjustment can fail when position or price data is stale, multiple processes submit…
The article compares trend following and mean reversion across holding periods, drawing on the author's earlier tests and a cited study spanning minutes to decades. Its broad synthesis is that mean reversion appears at horizons beyond roughly two years and…
This document describes operational checks for a systematic futures trading system. It compares monitoring displays to vehicle indicators: simple status lights, warnings, variable metrics, and interactive reports. The system logs timestamped messages by…
The document explains why traders need detailed profit and loss records: to assess results, attribute performance by instrument or strategy, compare live trading with simulations, monitor costs and realized risk, support client reporting and taxes, and scale…
This article develops a simple breakout trading rule and evaluates different lookback speeds across a set of futures markets. It discusses forecast scaling, turnover, and how trading costs can make the fastest breakouts impractical. The author notes that…
This technical guide explains how a Python client for Interactive Brokers can resolve futures contract details, submit market and limit orders, and modify or cancel open orders. It describes tracking order identifiers and listening for broker callbacks,…
The post sketches a short-horizon futures mean-reversion scalper built around symmetric bracket limit orders. It models the strategy as a state machine: after an entry fills, the bot protects the position with a stop while retaining a profit-taking order,…
This annual review reports portfolio-wide and futures results for the UK tax year, separating mark-to-market performance, interest, fees, commissions, and slippage. It also distinguishes pure futures returns from gains and losses associated with cash-like…
This tutorial outlines a workflow for requesting live futures data through Interactive Brokers’ native Python API. It resolves a contract, starts a market data subscription, stores incoming ticks in a queue, and later cancels the subscription and retrieves…
The document outlines operational and structural tradeoffs between large and small trading firms. It attributes advantages to large organizations in market breadth, assets under management, access to over-the-counter markets, data-cleaning capacity,…
The document explains how Docker can package a Python trading research environment with specific library versions and project code. The motivation is reproducibility: a legacy system may depend on older software versions, while its host machine still needs…
This document describes how a futures system can select contracts and move positions as delivery months change. It frames contract choice around liquidity, trading costs and calendar spreads, volatility and kurtosis, contango measurement, price action, and…
This annual review examines a futures trading account across asset classes and strategy groups. It compares returns with two benchmarks, reports summary performance statistics, and describes which markets and rule groups helped or hurt during the reviewed…
This document investigates whether fast trading rules can contribute to a futures portfolio without causing proportionally large trading costs. It traces how rule forecasts become positions through volatility and currency scaling, contract rolling,…