wumu2013

multi-factor-strategy

專業領域v1.0.0
作者:wumu2013更新於 2026-05-11@clawhub_wumu2013/multi-factor-strategy
金融分析行業研究#Stock

據 AlphaMoat 統計,截至 2026-10,multi-factor-strategy 累計下載 7,368 次、獲 3 個星標,按累計下載量在本次參與排名的 10,914 個 AI 技能中排名第 3,802 位,在「專業領域」分類(1,228 個)中排名第 416 位。

列表預設按累計下載量排序,也可按星標排序;詳情頁排名按累計下載量計算。

累計下載
7368
星標
3
全站下載量排名
#3,802
全站前 35% · 「專業領域」前 34%
平台累計下載星標評論
ClawHub ↗65473-
SkillHub ↗73683—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

引導確定策略目標、基本面和技術因子、篩選條件、因子方向、權重、標準化及 YAML 輸出。可混用內聯因子和外部引用,再檢查入選數量、分數分佈和集中度。安裝前需核驗固定 QuantCLI,檢查引用因子檔案;生成策略僅作決策輔助,不保證投資結果。

資料釋出於 2026-10-27

可以用來做什麼

  • 起草多因子篩選策略配置

什麼時候用

  • 研究流程需要明確因子、權重和輸出欄位時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

確定篩選目標和因子,準備 YAML 草稿,並列出執行前的資料、因子檔案和集中度檢查。

月度資料趨勢

累計下載7368
3624563576452026-03 · 累計下載 39012026-05 · 累計下載 46092026-06 · 累計下載 48832026-07 · 累計下載 51482026-08 · 累計下載 52702026-09 · 累計下載 62582026-10 · 累計下載 736826-0326-0926-10
星標3
2342026-03 · 星標 32026-05 · 星標 32026-06 · 星標 32026-07 · 星標 32026-08 · 星標 32026-09 · 星標 32026-10 · 星標 326-0326-0926-10

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-107368—3
2026-096258—3
2026-085270+2.4%3
2026-075148+5.4%3
2026-064883+5.9%3
2026-054609—3
2026-033901—3

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

8.5 KB · ClawHub v1.0.0
---
name: multi-factor-strategy
description: Guide users to create multi-factor stock selection strategies and generate independent YAML configuration files
---
{"homepage":"https://gitcode.com/datavoid/quantcli","user-invocable":true}

# Multi-Factor Strategy Assistant

Guide you to create multi-factor stock selection strategies and generate independent YAML configuration files.
展開全部(共 296 行)
## Install quantcli

```bash
# Install from PyPI (recommended)
pip install quantcli

# Or install from source
git clone https://gitcode.com/datavoid/quantcli.git
cd quantcli
pip install -e .
```

Verify installation:
```bash
quantcli --help
```

## Quick Start

A complete multi-factor stock selection strategy YAML example:

```yaml
name: Value-Growth Hybrid Strategy
version: 1.0.0
description: ROE + Momentum factor stock selection

screening:
  fundamental_conditions:    # Stage 1: Financial condition screening
    - "roe > 0.10"           # ROE > 10%
    - "pe_ttm < 30"          # P/E < 30
    - "pe_ttm > 0"           # Exclude losses
  daily_conditions:          # Stage 2: Price condition screening
    - "close > ma10"         # Above 10-day MA
  limit: 100                 # Keep at most 100 stocks

# Factor configuration (supports two methods, factors at top level)
factors:
  # Method 1: Inline factor definition
  - name: ma10_deviation
    expr: "(close - ma(close, 10)) / ma(close, 10)"
    direction: negative
    description: "10-day MA deviation"

  # Method 2: External reference (reference factor files in factors/ directory, include .yaml suffix)
  - factors/alpha_001.yaml
  - factors/alpha_008.yaml

ranking:
  weights:                   # Weight fusion
    ma10_deviation: 0.20     # Inline factor
    factors/alpha_001.yaml: 0.40  # External reference factor
    factors/alpha_008.yaml: 0.40
  normalize: zscore          # Normalization method

output:
  limit: 30                  # Output top 30 stocks
  columns: [symbol, name, score, roe, pe_ttm, close, ma10_deviation]
```

### Factor Configuration Methods

**Factor configuration supports two methods (can be mixed):**

| Method | Type | Example | Description |
|--------|------|---------|-------------|
| **Inline** | `dict` | `{name: xxx, expr: "..."}` | Define expression directly in YAML |
| **External** | `str` | `factors/alpha_001.yaml` | Load factor file from `factors/` directory |

**Example: Mixed usage**

```yaml
factors:
  # Inline: Custom factor
  - name: custom_momentum
    expr: "close / delay(close, 20) - 1"
    direction: positive

  # External: Alpha101 factor library (include .yaml suffix)
  - factors/alpha_001.yaml
  - factors/alpha_005.yaml
  - factors/alpha_009.yaml

ranking:
  weights:
    custom_momentum: 0.3
    factors/alpha_001.yaml: 0.3
    factors/alpha_005.yaml: 0.2
    factors/alpha_009.yaml: 0.2
```

Run strategy:
```bash
quantcli filter run -f your_strategy.yaml
```

## Invocation

```
/multi-factor-strategy
```

## Available Expression Functions

### Data Processing Functions
| Function | Usage | Description |
|----------|-------|-------------|
| delay | `delay(x, n)` | Lag n periods |
| ma | `ma(x, n)` | Simple moving average |
| ema | `ema(x, n)` | Exponential moving average |
| rolling_sum | `rolling_sum(x, n)` | Rolling sum |
| rolling_std | `rolling_std(x, n)` | Rolling standard deviation |

### Technical Indicator Functions
| Function | Usage | Description |
|----------|-------|-------------|
| rsi | `rsi(x, n=14)` | Relative strength index |
| correlation | `correlation(x, y, n)` | Correlation coefficient |
| cross_up | `cross_up(a, b)` | Golden cross (a crosses above b) |
| cross_down | `cross_down(a, b)` | Death cross (a crosses below b) |

### Ranking & Normalization Functions
| Function | Usage | Description |
|----------|-------|-------------|
| rank | `rank(x)` | Cross-sectional ranking (0-1) |
| zscore | `zscore(x)` | Standardization |
| sign | `sign(x)` | Sign function |
| clamp | `clamp(x, min, max)` | Clipping function |

### Conditional Functions
| Function | Usage | Description |
|----------|-------|-------------|
| where | `where(cond, t, f)` | Conditional selection |
| if | `if(cond, t, f)` | Conditional selection (alias) |

### Base Fields
| Field | Description |
|-------|-------------|
| open, high, low, close | OHLC prices |
| volume | Trading volume |
| pe, pb | P/E ratio, P/B ratio |
| roe | Return on equity |
| netprofitmargin | Net profit margin |

## Guided Workflow

### Step 1: Strategy Goal定位

I will first understand your strategy needs:
- **Strategy Type**: Value, Growth, Momentum, Volatility, Hybrid
- **Selection Count**: Concentrated(10-30), Medium(50-100), Diversified(200+)
- **Holding Period**: Intraday, Short-term(week), Medium-term(month), Long-term(quarter)

### Step 2: Factor Selection

Based on your strategy goals, recommend suitable factor combinations:

**Common Fundamental Factors**:
| Factor | Expression | Direction | Description |
|--------|------------|-----------|-------------|
| roe | `roe` | positive | Return on equity |
| pe | `pe` | negative | Lower P/E is better |
| pb | `pb` | negative | Price-to-book ratio |
| netprofitmargin | `netprofitmargin` | positive | Net profit margin |
| revenue_growth | `revenue_yoy` | positive | Revenue growth rate |

**Common Technical Factors**:
| Factor | Expression | Direction | Description |
|--------|------------|-----------|-------------|
| momentum | `(close/delay(close,20))-1` | positive | N-day momentum |
| ma_deviation | `(close-ma(close,10))/ma(close,10)` | negative | MA deviation |
| ma_slope | `(ma(close,10)-delay(ma(close,10),5))/delay(ma(close,10),5)` | positive | MA slope |
| volume_ratio | `volume/ma(volume,5)` | negative | Volume ratio |

**Alpha101 Built-in Factors** (can reference `{baseDir}/alpha101/alpha_XXX`):

QuantCLI includes 40 WorldQuant Alpha101 factors that can be directly referenced:

| Factor | Category | Description |
|--------|----------|-------------|
| `alpha101/alpha_001` | Reversal | 20-day new high then decline |
| `alpha101/alpha_002` | Reversal | Down volume bottom |
| `alpha101/alpha_003` | Volatility | Low volatility stability |
| `alpha101/alpha_004` | Capital Flow | Net capital inflow |
| `alpha101/alpha_005` | Trend | Uptrend |
| `alpha101/alpha_008` | Capital Flow | Capital inflow |
| `alpha101/alpha_009` | Momentum | Long-term momentum |
| `alpha101/alpha_010` | Reversal | MA deviation reversal |
| `alpha101/alpha_011` ~ `alpha_020` | Extended | Volatility, momentum, price-volume factors |
| `alpha101/alpha_021` ~ `alpha_030` | Extended | Price-volume, trend, strength factors |
| `alpha101/alpha_031` ~ `alpha_040` | Extended | Position, volatility, capital factors |

**View all built-in factors:**
```bash
quantcli factors list
```

**Usage Example:**
```yaml
factors:
  - alpha101/alpha_001   # Reversal factor
  - alpha101/alpha_008   # Capital inflow
  - alpha101/alpha_029   # 5-day momentum
ranking:
  weights:
    alpha101/alpha_001: 0.4
    alpha101/alpha_008: 0.3
    alpha101/alpha_029: 0.3
```

**Screening Conditions Example**:
```yaml
screening:
  conditions:
    - "roe > 0.10"              # ROE > 10%
    - "netprofitmargin > 0.05"  # Net profit margin > 5%
```

### Step 3: Weight Configuration

Allocate weights based on factor importance, 0 means only for screening, not scoring:

```yaml
ranking:
  weights:
    # Fundamental factors
    roe: 0.30
    pe: 0.20
    # Technical factors
    ma_deviation: 0.30
    momentum: 0.20
  normalize: zscore
```

### Step 4: Generate Strategy File

I will generate a complete strategy YAML file for you:

```yaml
name: Your Strategy Name
version: 1.0.0
description: Strategy description

# Stage 1: Fundamental screening
screening:
  conditions:
    - "roe > 0.10"
    - "pe < 30"
  limit: 200

# Stage 2: Technical ranking
ranking:
  weights:
    roe: 0.30
    pe: 0.20
    ma_deviation: 0.30
    momentum: 0.20
  normalize: zscore

output:
  columns: [symbol, score, rank, roe, pe, momentum]
  limit: 30
```

### Step 5: Run & Evaluate

**Run strategy**:
```bash
quantcli filter run -f your_strategy.yaml --top 30
```

**Evaluation points**:
1. **Selected stock count**: Check if screening conditions are reasonable
2. **Factor distribution**: Distribution of factor scores
3. **Industry diversification**: Avoid over-concentration

## FAQ

**Q: How to allocate factor weights?**
A: Core factors 0.3-0.4, auxiliary factors 0.1-0.2, ensure weights sum close to 1

**Q: Screening conditions too strict resulting in empty results?**
A: Gradually relax conditions, first see how many stocks meet each condition

**Q: What expression syntax is supported?**
A: Supports 40+ built-in functions: `ma()`, `ema()`, `delay()`, `rolling_sum()`, `rsi()`, `rank()`, `zscore()`, etc.

「專業領域」分類下的熱門技能

AIGC過程存證服務專業領域

AIGC創作過程自動存證技能。自動識別創作平台與生成工具,將創作過程記錄存證並蓋有公安備案電子印章,具備可信時間戳,可以在全國電子印章互認平台核驗。

↓ 390萬★ 7u_c2c77b5f
防詐專家專業領域

反電信網路詐騙(反詐)專家技能。當用戶描述一個疑似詐騙的場景、簡訊、電話、連結、聊天記錄、App、投資平台、招聘資訊或轉賬要求,並詢問「這是不是詐騙」「要不要轉錢」「怎麼止損」「錢還能不能追回來」,或需要識別詐騙話術、拆解騙局結構、生成報案材料與取證清單時使用。同時在對話中主動嗅探「轉賬、驗證碼、螢幕共享、安全帳戶、保證金、刷單、穩賺、百萬保障、跑分」等風險詞並插入預警,即使對方並未詢問反詐。適用場景還包括:家屬求助勸阻疑似被騙的親人、企業/銀行/支付機構/網際網路平台做涉詐帳戶識別與交易監測規則、涉詐資金鍊(跑分、卡四件套、GOIP)分析、反詐合規與員工培訓、反詐實戰演練。

↓ 168.7萬★ 4user_e9185b15
全國電子印章互認平台專業領域

電子印章公安備案、全網互認,實現所有格式檔案電子簽章與影片確權,覆蓋全國所有CA廠商自2005年以來的全量電子簽章資料,無論由哪個地區、哪套系統、哪家CA機構簽發,均可精準校驗與互認。

↓ 141.6萬★ 8u_c2c77b5f
baozheng-skills專業領域

包拯.Skills你身邊的專家律師團 — 專業法律諮詢 + 要素式/通用起訴狀起草 + 刑事專項材料輔助 + 法條分析與法規檢索。flk.npc.gov.cn API即時法條優先,不可用時AI知識庫降級兜底,**法條來源按四檔標註可核驗(已核驗-flk API / 已核驗-單源 / 已引-離線庫 / 未核驗-模型生成),交付末尾附法條/事實/金額/程式分項置信度**;以22類法律領域覆蓋矩陣約束路由邊界;支援35個起訴狀模板、5類刑事專項材料輔助;內建Logic Doctor邏輯自檢、訴訟時效追蹤及10類異常容錯處理(含連續失敗熔斷);漸進式意圖收斂協議(3輪狀態機);混合意圖自動任務拆解(按依賴排序→合併→順序執行);含反模式清單與危機干預出口(自殺/家暴/未成年人侵害先於一切法律分析)。非標準案由自動使用通用模板。

↓ 52.7萬★ 2user_814dbe54
律師助手專業領域

律師AI辦案工作臺:從接案到結案全流程提效——案件分析、要件梳理、文書初稿、證據質證、法庭攻防演練、賠償與費用計算、期限提醒、復盤歸檔;覆蓋民事、刑事、勞動、非訴、破產、執行、行政、仲裁八大領域,111 個專家技能;法條可核驗、結論可複核。

↓ 50.7萬★ 77user_cd0fcd93
包拯.SKILL專業領域

包拯.Skills你身邊的專家律師團 — 專業法律諮詢 + 要素式/通用起訴狀起草 + 刑事專項材料輔助 + 法條分析與法規檢索。flk.npc.gov.cn API即時法條優先,不可用時AI知識庫降級兜底,**法條來源按四檔標註可核驗(已核驗-flk API / 已核驗-單源 / 已引-離線庫 / 未核驗-模型生成),交付末尾附法條/事實/金額/程式分項置信度**;以22類法律領域覆蓋矩陣約束路由邊界;支援35個起訴狀模板、5類刑事專項材料輔助;內建Logic Doctor邏輯自檢、訴訟時效追蹤及10類異常容錯處理(含連續失敗熔斷);漸進式意圖收斂協議(3輪狀態機);混合意圖自動任務拆解(按依賴排序→合併→順序執行);含反模式清單與危機干預出口(自殺/家暴/未成年人侵害先於一切法律分析)。非標準案由自動使用通用模板。

↓ 42.4萬★ 41user_741dc82b
專利初稿助手專業領域

基於技術交底書生成專利申請初稿。技術交底書內容至少包含技術問題、解決方案、技術效果。內建的推理、視覺、多模態、數學、函式、模擬等模型底座均為國產,國外模型0使用,可放心食用。 近期安裝量暴增感謝支援,不少私信希望能力提升但這已是國產極限,我們不必追求最強技能,達到及格即可。學習交流歡迎聯絡微訊號A26dian4

↓ 36.9萬★ 48user_9c63fdb4
露禾論文寫作助手(免費版pro)專業領域

露禾論文寫作助手(免費版):一句話生成引用可溯源、不編造的專業學術論文,按國標 GB/T 7714 插入真實文獻引用,中英文 3000/5000/8000 字,一鍵匯出 Word。說「寫論文 / 幫我寫論文」即可使用。

↓ 35萬★ 18u_a3c224a2

資料月份:2026-10 · 下載/星標數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。