一键导入
pair-trading
Pair trading strategy. Trades mean reversion using the spread/ratio Z-score of two correlated instruments. Requires at least two instruments.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Pair trading strategy. Trades mean reversion using the spread/ratio Z-score of two correlated instruments. Requires at least two instruments.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Candlestick pattern recognition engine, pure pandas vectorized implementation of 15 classic candlestick patterns (5 single-candle + 5 double-candle + 4 triple-candle + 1 trend confirmation), generating a composite signal from bullish/bearish pattern scores.
基于缠论(缠中说禅)的形态识别引擎,使用czsc库自动检测K线分型、笔、中枢,并生成一买/一卖/二买/二卖/三买/三卖等买卖点信号。支持多周期分析和形态分类(3/5/7/9/11笔形态)。
A股可转债分析——转股/纯债/期权三维估值、下修/强赎/回售博弈、双低策略与转债轮动选债框架
公司事件驱动分析:并购套利价差计算、大股东增减持信号、股权激励解读、定增配股影响评估、A股ST/退市预警
Data source selection — VN-only. All data comes from vnstock (fundamentals + OHLCV) and VietFin DNSE (OHLCV fallback).
Elliott Wave Theory signal engine. Detects swing points through Zigzag, matches 5-wave impulse and 3-wave corrective structures, validates them with Fibonacci wave relationships, and generates trend-top / correction-complete signals. Pure in-house pandas implementation.
| name | pair-trading |
| description | Pair trading strategy. Trades mean reversion using the spread/ratio Z-score of two correlated instruments. Requires at least two instruments. |
| category | strategy |
Select two highly correlated instruments (such as stocks from the same industry or BTC/ETH), monitor how far their price ratio (or spread) deviates from the mean, and trade against extreme deviations while waiting for mean reversion.
ratio = close_A / close_Bmean = ratio.rolling(lookback).mean(), std = ratio.rolling(lookback).std()z = (ratio - mean) / stdcodes array length = 2)leg1), and the second is B (leg2)| Parameter | Default | Description |
|---|---|---|
| lookback | 60 | Lookback window for mean and standard deviation |
| entry_z | 2.0 | Entry Z-score threshold |
| exit_z | 0.5 | Exit Z-score threshold |
config.json{
"source": "vietfin",
"codes": ["VIC", "VHM"],
"start_date": "2023-01-01",
"end_date": "2024-12-31",
"initial_cash": 1000000,
"commission": 0.001,
"extra_fields": null
}
Cryptocurrency version:
{
"source": "okx",
"codes": ["BTC-USDT", "ETH-USDT"],
"start_date": "2024-01-01",
"end_date": "2024-12-31",
"initial_cash": 1000000,
"commission": 0.001,
"extra_fields": null
}
codes must contain exactly 2 instruments, no more and no lessNaN, so fill signals with 0pip install pandas numpy
0.5 = long, -0.5 = short, 0 = flat