pair-trading

Analyze asset price ratios and Z-scores to generate pair trading signals.

15|2|Updated May 1, 2026
One-click install
npx skills add https://github.com/OpenSucker/OpenSucker --skill pair-trading-opensucker
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pair-trading
Source: https://github.com/OpenSucker/OpenSucker/tree/main/skills/vibe_skills/pair-trading
Command: npx skills add https://github.com/OpenSucker/OpenSucker --skill pair-trading-opensucker

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, numpy, and includes scripts (resource) components.

What problem does it solve?

This Skill enables systematic implementation of pair trading by analyzing the spread of two correlated assets, facilitating disciplined, mean-reversion based trades.

Core Features & Use Cases

  • Price Ratio Analysis: Automatically computes the ratio between two assets' prices to identify deviations from the historical mean.
  • Z-score Signal Generation: Uses rolling windows to calculate Z-scores, generating buy/sell signals when assets deviate significantly.
  • Use Case: An investor can deploy this Skill to trade pairs like stocks or cryptocurrencies by executing trades when ratios reach specific thresholds, aiming to profit from reversion to the mean.

Quick Start

Use this Skill to process two assets' historical data, generate trading signals based on their price relationship, and inform trading decisions.

Frequently Asked Questions about pair-trading

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I calculate the Z-score for a pair trading strategy?

To calculate the Z-score for pair trading, you compute the ratio between two correlated assets' prices and use rolling windows to measure deviations from the historical mean, generating buy or sell signals.

What is mean reversion in algorithmic trading?

Mean reversion in algorithmic trading is the assumption that asset price relationships will return to their historical average, allowing you to profit by analyzing the spread between two correlated assets.

Can I apply pair trading signals to both stocks and crypto?

Yes, you can apply pair trading signals to both stocks and crypto. The strategy analyzes asset price relationships for mean reversion opportunities across both traditional and cryptocurrency markets.

Do I need pandas and numpy to build a pair trading script?

Yes, you need pandas and numpy to build a pair trading script. These dependencies are required to process historical asset data and perform the mathematical ratio and Z-score calculations.

How do I generate buy and sell signals from asset price ratios?

You generate buy and sell signals from asset price ratios by applying rolling windows to calculate Z-scores, which trigger trades when the correlated assets deviate significantly from their historical mean.

What are the limitations of using Z-score thresholds for crypto pair trading?

A limitation of using Z-score thresholds for crypto pair trading is that it assumes genuine mean reversion; if the underlying correlation between the two assets breaks down, the price ratio may not revert.