Skip to content
All library documents

Integrating Single-Leg Execution Algorithms with Spread Trading

Article vn.py community

Summary

This discussion explains how to connect a spread-trading strategy with single-contract execution algorithms such as TWAP or best-limit. It distinguishes spread-level execution, which coordinates multiple legs, from algorithms that execute orders for one contract. The proposed approach is to extend the spread taker algorithm and replace its leg-order submission behavior, while retaining the sequence in which an active leg is traded and passive legs are hedged. A strategy-level alternative is also described, though it requires additional handling of fills and hedging.

The examples are implementation sketches, not verified production code or evidence of execution performance. The discussion highlights practical requirements: handle partial fills, avoid excessive hedging, respect contract volume increments and price limits, and coordinate algorithm completion with hedge orders. The specific APIs, engine names, and methods may depend on the VeighNa version and require checking against the installed source before use.

Key ideas

  • Spread execution coordinates multiple legs, while TWAP and similar algorithms generally handle one contract at a time.
  • A custom spread algorithm can delegate leg orders to a single-contract algorithm engine.
  • The active-leg fill must be coordinated with hedging of passive legs.
  • Partial fills and total spread exposure need explicit management.
  • The sample implementation is a design sketch and may need adaptation to the installed software version.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.