pair-trading

Generate equal-weight long-short signals from rolling Z-score spread deviations.

Updated Apr 9, 2026
One-click install
npx skills add https://github.com/JacobHsu/vibe-trading-agent --skill pair-trading-jacobhsu
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pair-trading
Source: https://github.com/JacobHsu/vibe-trading-agent/tree/main/agent/src/skills/pair-trading
Command: npx skills add https://github.com/JacobHsu/vibe-trading-agent --skill pair-trading-jacobhsu

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill monitors the spread between two correlated assets to automate mean-reversion entries and exits whenever manual ratio tracking would be too slow or error-prone.

Core Features & Use Cases

  • Spread monitoring: computes the price ratio of the two aligned instruments and smooths it with a rolling lookback to derive a statistically meaningful Z-score.
  • Signal generation: emits opposite long/short positions based on entry and exit Z thresholds with equal-weight allocation and NaN-safe defaults.
  • Use case: feed OHLCV history for a stock pair or crypto pair and let the Skill trigger hedge trades when the spread diverges beyond the configured thresholds.

Quick Start

Ask the pair-trading skill to analyze BTC-USDT and ETH-USDT and signal entries when their price ratio deviates beyond the configured Z-score thresholds.

Frequently Asked Questions about pair-trading

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

FAQPage Schema
How do I generate mean-reversion signals for correlated assets?

Use a rolling z-score to monitor the price ratio spread between two correlated instruments. The workflow computes the spread over a defined lookback window and emits opposite long-short positions when deviations exceed configured entry and exit thresholds.

What is pair trading and how does z-score trigger entry and exit points?

Pair trading captures mean-reversion by monitoring the price ratio between two correlated assets. The z-score measures spread deviations from a rolling lookback mean, triggering equal-weight long-short entries at extreme values and exits when the spread reverts.

Can I use pandas for crypto pair trading on BTC and ETH?

Yes, the pair-trading workflow supports crypto pairs like BTC-USDT and ETH-USDT. It uses pandas to align the time series and compute the rolling z-score on their price ratio, signaling hedge trades when the spread diverges beyond set thresholds.

How do I set lookback windows and thresholds for a hedged pair trading strategy?

Define a rolling lookback window to smooth the price ratio into a z-score, then set entry and exit thresholds for the hedged strategy. The workflow triggers equal-weight long-short signals when the z-score crosses these configured boundaries.

Does this mean-reversion signal generation handle missing data in aligned time series?

Yes, the mean-reversion signal generation applies NaN-safe defaults to handle missing data in aligned time series. This ensures the rolling z-score computation and subsequent long-short signal generation remain accurate despite gaps in OHLCV history.