pair-trading

Calculate Z-scores of price ratios between correlated financial instruments.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/20YN04/vibe-trading-macos --skill pair-trading-20yn04
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pair-trading
Source: https://github.com/20YN04/vibe-trading-macos/tree/main/agent/src/skills/pair-trading
Command: npx skills add https://github.com/20YN04/vibe-trading-macos --skill pair-trading-20yn04

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, numpy.

What problem does it solve?

This Skill addresses the complexity of identifying and executing mean-reversion trades between two correlated financial instruments, removing the need for manual spread monitoring and calculation.

Core Features & Use Cases

  • Z-Score Analysis: Automatically calculates the rolling mean and standard deviation of the price ratio between two assets to identify entry and exit points.
  • Long-Short Hedging: Generates synchronized signals to long one asset and short another when the spread deviates significantly from the historical mean.
  • Use Case: A trader wants to capitalize on the historical correlation between two stocks or cryptocurrencies; this Skill identifies when the relationship is stretched and triggers a trade to capture the expected reversion.

Quick Start

Use the pair-trading skill to generate signals for BTC-USDT and ETH-USDT using a 60-day lookback window.

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 mean-reversion trading strategy?

To calculate the Z-score for mean-reversion trading, compute the rolling mean and standard deviation of the price ratio between two correlated assets. This identifies when the spread deviates significantly from its historical average, signaling potential long-short entry points.

How do I execute long-short hedge trades on correlated cryptocurrencies?

You execute long-short hedge trades on correlated cryptocurrencies by generating synchronized signals to long one asset and short another. This captures the expected price reversion when the spread between assets stretches beyond standard statistical limits.

Can I use pandas and numpy for rolling statistical analysis on OHLCV market data?

Yes, you can use pandas and numpy for rolling statistical analysis on OHLCV market data. These libraries perform the mathematical calculations required to derive the rolling mean and standard deviation needed for accurate Z-score pair trading analysis.

What is pair trading and how does it identify mean-reversion opportunities?

Pair trading is a quantitative strategy that identifies mean-reversion opportunities by monitoring the price ratio between two historically correlated financial instruments. It triggers trades when this ratio deviates significantly from its established historical mean.

Does this mean-reversion approach work for both stocks and cryptocurrencies?

Yes, this mean-reversion approach works for both stocks and cryptocurrencies. The quantitative strategy applies Z-score analysis to any correlated financial instruments requiring synchronized long-short hedge execution across different asset classes.