Agent skill · Testing & QA

longbridge-pairs-trading

Pairs trading / statistical-arbitrage strategy via Longbridge Securities — tests cointegration between two correlated assets using the Engle-Granger (ADF) method, computes the optimal hedge ratio via OLS, calculates spread Z-score, half-life of mean reversion, and generates entry/exit signals (long spread when Z > 2, short spread when Z < -2, exit when |Z| < 0.5). Triggers: "配对交易", "统计套利", "协整", "价差交易", "对价交易", "双股套利", "配對交易", "統計套利", "協整", "價差交易", "pairs trading", "statistical arbitrage", "cointegration", "spread trading", "mean reversion pairs", "hedge ratio", "half-life", "ADF test", "Kalma

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill longbridge-pairs-trading --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 4 KB
Bundled scripts: none
Version: 1.0.0
Declared author: longbridge
Path: skills/analysis/longbridge-pairs-trading/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# longbridge-pairs-trading Statistical-arbitrage strategy for a pair of correlated securities. Tests for cointegration, estimates hedge ratio, computes spread Z-score, and outputs actionable long/short signals with half-life and position sizing guidance. > **Response language**: match the user's input language — Simplified Chinese / Traditional Chinese / English. ## When to use - User provides two ticker symbols and asks for pairs trading analysis, spread mean-reversion, cointegration test, or statistical arbitrage. - Triggers: "MSFT 和 GOOGL 配对交易", "HSBC vs StanChart 协整", "pairs trade AAPL MSFT", "价差均值回归". ## Workflow 1. Fetch 252 daily candles for each symbol: ``` longbridge kline <SYMBOL_A> --period day --count 252 --format json longbridge kline <SYMBOL_B> --period day --count 252 --format json ``` 2. Align on `time`, drop unmatched rows (different trading calendars). 3. **Cointegration test (Engle-Granger)**: - OLS regress `ln(close_A)` on `ln(close_B)` → hedge ratio β - Compute residuals (spread) = `ln(close_A) − β × ln(close_B)` - Run ADF test on residuals; if p-value < 0.05, declare cointegrated 4. **Spread statistics**: - Spread mean μ, std σ - Z-score = (spread_current − μ)

What's inside
Steps it walks through
  1. When to use
  2. Workflow
  3. CLI
  4. Output
  5. Error handling
  6. MCP fallback
  7. Related skills
  8. File layout
Ships with 1 file
  • metadata.json
Commands it runs
longbridge kline --help
longbridge kline <SYMBOL_A> --period day --count 252 --format json
longbridge kline <SYMBOL_B> --period day --count 252 --format json
More from claude-skill-registry
All skills →
About this skill
What does the longbridge-pairs-trading skill do?

Pairs trading / statistical-arbitrage strategy via Longbridge Securities — tests cointegration between two correlated assets using the Engle-Granger (ADF) method, computes the optimal hedge ratio via OLS, calculates spread Z-score, half-life of mean reversion, and generates entry/exit signals (long spread when Z > 2, short spread when Z < -2, exit when |Z| < 0.5). Triggers: "配对交易", "统计套利", "协整", "价差交易", "对价交易", "双股套利", "配對交易", "統計套利", "協整", "價差交易", "pairs trading", "statistical arbitrage", "cointegration", "spread trading", "mean reversion pairs", "hedge ratio", "half-life", "ADF test", "Kalma

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill longbridge-pairs-trading --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going