Loading...
Loading...
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", "Kalman filter", "Z-score spread", "spread mean reversion".
npx skill4agent add longbridge/skills longbridge-pairs-tradingResponse language: match the user's input language — Simplified Chinese / Traditional Chinese / English.
longbridge kline <SYMBOL_A> --period day --count 252 --format json
longbridge kline <SYMBOL_B> --period day --count 252 --format jsontimeln(close_A)ln(close_B)ln(close_A) − β × ln(close_B)longbridge kline --helplongbridge kline --help
longbridge kline <SYMBOL_A> --period day --count 252 --format json
longbridge kline <SYMBOL_B> --period day --count 252 --format json| Metric | 简体 | 繁體 | English |
|---|---|---|---|
| Hedge ratio β | 对冲比率 | 對沖比率 | Hedge ratio |
| Cointegration p-value | 协整 p 值 | 協整 p 值 | Cointegration p-value |
| Spread Z-score | 价差 Z 分 | 價差 Z 分 | Spread Z-score |
| Half-life | 半衰期(天) | 半衰期(天) | Half-life (days) |
| Signal | 交易信号 | 交易訊號 | Trade signal |
| Situation | 简体回复 | 繁體回復 | English reply |
|---|---|---|---|
| 回退到 MCP 或提示安装 longbridge-terminal | 回退到 MCP 或提示安裝 longbridge-terminal | Fall back to MCP or install longbridge-terminal |
| 请运行 | 請執行 | Run |
| ADF p-value > 0.05 | 两标的未通过协整检验,配对交易风险较高 | 兩標的未通過協整檢驗,配對交易風險較高 | Not cointegrated; pairs trade is high-risk |
| Insufficient overlapping dates | 两标的历史数据重叠不足,无法建立配对 | 兩標的歷史數據重疊不足 | Insufficient overlapping history |
| Other stderr | 直接显示原始错误 | 直接顯示原始錯誤 | Surface verbatim |
mcp__longbridge__candlesticksperiod=Daycount=252longbridge-klinelongbridge-correlationlongbridge-volatility-strategylongbridge-pairs-trading/
└── SKILL.md