pair-trading

Calculate Z-scores of price ratios to generate long-short mean-reversion signals.

Updated Jul 8, 2026
One-click install
npx skills add https://github.com/hxhyyy/Vibe-Trading --skill pair-trading-hxhyyy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pair-trading
Source: https://github.com/hxhyyy/Vibe-Trading/tree/main/agent/src/skills/pair-trading
Command: npx skills add https://github.com/hxhyyy/Vibe-Trading --skill pair-trading-hxhyyy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, numpy.

What problem does it solve?

This Skill addresses the challenge 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 statistical anomalies.
  • Automated Signal Generation: Triggers long/short signals based on configurable Z-score thresholds to capture expected price convergence.
  • Use Case: A trader can use this to monitor a pair like BTC/ETH or two stocks in the same sector, automatically entering a long-short hedge when the spread deviates significantly from the historical mean.

Quick Start

Use the pair-trading skill to generate signals for the BTC-USDT and ETH-USDT pair 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?

This skill calculates the Z-score for mean-reversion trading by computing the rolling mean and standard deviation of the price ratio between two correlated financial instruments, generating long-short signals based on statistical deviation thresholds.

How do I automate long-short signal generation for correlated crypto assets?

You can automate long-short signal generation for correlated crypto assets by configuring Z-score thresholds, which triggers entry signals capturing expected price convergence when the spread deviates significantly from the historical mean.

Do I need pandas and numpy to run quantitative trading calculations?

Yes, you need pandas and numpy to run these quantitative trading calculations, as the skill requires them for executing rolling window calculations and vectorizing the long-short trading signals.

Can I use a 60-day lookback window to monitor a BTC and ETH trading pair?

Yes, you can use a 60-day lookback window to monitor a BTC and ETH trading pair, generating automated long-short hedge signals when the price ratio spread deviates from the historical mean.

What is the best way to identify statistical anomalies in asset price ratios?

The best way to identify statistical anomalies in asset price ratios is calculating the Z-score of the spread, which highlights when current prices deviate significantly from historical rolling averages to signal mean-reversion.

When should I not use a mean-reversion approach for quantitative trading?

You should not use a mean-reversion approach when the statistical correlation between the two financial instruments breaks down, as the Z-score signals become invalid if the assets stop exhibiting historically correlated price ratios.