Skip to main content
Any Framework

Pairs Trading Stocks Strategy (Python)

Published
Aug 7, 2025
1y ago
Total Downloads
758
758

Install

dotnet add package StockSharp.Strategies.0388_Pairs_Trading_Stocks.py --version 5.0.0

No framework information available.

README

Pairs Trading Stocks Strategy (Python Version)

This simplified pairs trading strategy operates on multiple stock pairs. For each pair the price ratio is tracked over a rolling window and its z-score is computed. When the z-score exceeds an entry threshold a long/short trade is opened; positions are closed when the z-score reverts.

The algorithm supports trading multiple independent pairs simultaneously.

Details

  • Universe: list of stock pairs.
  • Signal: z-score of price ratio crossing EntryZ.
  • Exit: close when z-score reaches ExitZ.
  • Data: daily candles with 60-day lookback by default.
  • Risk control: trades skipped when order value below MinTradeUsd.

Adoption Assessment

A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.

No SPDX license expression is published. Review the license text and your organisation's policy before redistribution.No target framework metadata is available. Confirm compatibility in a representative project before standardising on this package.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.