This guide lays out a futures data workflow for a trading system. It starts with instrument settings, spread costs, and roll parameters, then gathers individual contract histories, builds roll calendars, creates multiple-price series, derives back-adjusted…
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
10 documents
This example assembles a futures trend-following system on hourly data and shows how to choose among vanilla accounting, simulated market orders, and simulated limit orders. The system combines raw data, trading rules, forecast scaling and combination,…
This short Python example shows how to assemble a daily futures trading system with an order simulator. It creates a data source, loads configuration, and constructs a system from account, portfolio, position-sizing, forecast-combination, forecast-scaling,…
This example adapts a pysystemtrade introductory trading rule to use spot foreign exchange prices from Interactive Brokers rather than futures prices from CSV files. It connects through ib_insync, retrieves configured currency-pair histories, and illustrates…
This introduction shows how to build a futures trading rule and assemble it into a larger systematic trading process. Its example EWMAC forecast subtracts a slow exponential moving average from a fast one, then normalizes the difference by a robust estimate…
This document lays out an ordered process for adding a strategy to a live trading system or replacing an existing one. It covers preparing instrument data, confirming a working backtest, configuring strategy and control files, implementing custom backtest,…
This user guide describes pysystemtrade as a framework for constructing futures backtests and modifying their components. It covers common tasks such as selecting instruments and date ranges, changing configurations, writing trading rules, inspecting…
This document explains how a futures trading system uses several instrument sets: the full catalog, instruments sampled for price data, instruments with adjusted prices, and the smaller sets used in simulation or production backtests. It describes…
This code models order and trade state for a scalping system. When flat with no open orders, it places buy and sell limit orders around the current price, with their distance based on a volatility-like measure R and a configurable multiplier. After one order…
The code builds a portfolio of instruments through a greedy selection process. It first scores each eligible instrument individually, then repeatedly adds the candidate that gives the highest estimated portfolio Sharpe ratio. Correlations enter through a…