This implementation models a spread as a collection of instrument legs, with separate multipliers for calculating its quoted price and translating spread quantities into leg quantities. It combines leg bid and ask prices, reversing which side is used for…
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 document explains how to build a multi-contract strategy using synchronized bar data, per-leg targets, and order management. Its example computes the spread between two weighted contract prices, updates a rolling window, and uses Bollinger Bands to…
The document describes a two-leg spread strategy built around Bollinger Bands. It calculates a weighted price difference between two contracts, samples the spread on a five-minute schedule, and compares it with a rolling mean and standard deviation. A move…
This guide explains execution algorithms that divide large orders, react to market prices, and adjust positions on a grid or across a spread. It describes time-weighted execution, iceberg orders, a tick-driven sniper approach, conditional orders, and…
This document describes a graphical interface for defining and monitoring spread trades. Users can create standard or flexible spreads, specify leg instruments and directions, set a pricing formula, identify an active leg, and enter minimum trade volume. The…
This strategy forms a spread from two instruments’ bar closes, weighted by configurable leg ratios. It updates the spread at five-minute intervals, keeps a rolling history, and calculates a moving average with upper and lower bands based on the spread’s…
This document describes the data model and calculations behind a synthetic multi-leg spread. Each leg stores its market quotes, contract details, and position state. Configurable price multipliers define the spread price, while trading multipliers define how…
This guide explains spread trading across related instruments, contrasting it with single-instrument trend strategies. It presents several approaches: latency-sensitive arbitrage between equivalent markets, threshold or Bollinger Band mean-reversion trades…
This document explains how to represent a multi-leg spread using separate price and trading multipliers. It derives synthetic bid and ask prices from each leg’s best quotes, reversing which side of a leg’s market contributes when its price multiplier is…
This spread strategy uses Bollinger Bands to enter and exit positions. After building spread bars and waiting for its array manager to initialize, it calculates the moving average and upper and lower bands over a configurable window. When flat, it opens a…