pair-trading

Generate mean-reversion trading signals for two correlated assets using pandas.

Updated Apr 12, 2026
One-click install
npx skills add https://github.com/DaddyElonMusk69/motis-agent --skill pair-trading-daddyelonmusk69
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: pair-trading
Source: https://github.com/DaddyElonMusk69/motis-agent/tree/main/skills/finance/pair-trading
Command: npx skills add https://github.com/DaddyElonMusk69/motis-agent --skill pair-trading-daddyelonmusk69

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Traders need a systematic way to exploit mean-reversion between two highly correlated instruments without manually calculating ratios and Z-scores.

Core Features & Use Cases

  • Signal Engine: Computes price ratio, rolling mean, standard deviation, and Z-score to generate long/short signals.
  • Equal-weight Allocation: Automatically assigns 50 % capital to each leg of the pair.
  • Applicable Assets: Works with equities, ETFs, or cryptocurrencies such as BTC/ETH.
  • Use Case: Generate daily trading signals for a pair of stocks to feed into an execution system.

Quick Start

Ask the pair‑trading skill to produce signals for BTC‑USDT and ETH‑USDT from Jan 2024 to Dec 2024.

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 trading signals for a pair of correlated stocks?

Mean-reversion trading signals are generated by computing the price ratio, rolling mean, standard deviation, and Z-score of two correlated assets to determine entry and exit points. You provide exactly two instruments, a lookback window, and entry/exit Z-score thresholds to output long/short signals.

Can I use pandas to calculate Z-score entry and exit points for cryptocurrency pairs?

Yes, you can use pandas to calculate Z-score entry and exit points for cryptocurrency pairs like BTC and ETH. The signal engine computes the price ratio and rolling statistics to output long/short signals for these correlated digital assets.

What inputs are required to calculate pair-trading signals for ETFs?

Calculating pair-trading signals requires exactly two instruments, a lookback window, and entry/exit Z-score thresholds. The engine applies these inputs to the ETF price data to compute the rolling mean and standard deviation for signal generation.

How does equal-weight allocation work in a mean-reversion pair-trading strategy?

Equal-weight allocation in a mean-reversion pair-trading strategy automatically assigns 50% capital to each leg of the pair. This ensures the long and short positions are balanced when Z-score thresholds trigger entry and exit signals.

What is the best way to automate daily signal generation for a correlated asset pair?

Automating daily signal generation involves computing the rolling price ratio and Z-score deviations for two correlated assets. The resulting long/short signals can be directly fed into an execution system to manage the mean-reversion trades.

Does this mean-reversion approach work with more than two assets at once?

No, this mean-reversion approach does not work with more than two assets at once. The signal generation requires exactly two instruments to compute the price ratio and Z-score deviations necessary for identifying entry and exit points.