본문으로 건너뛰기
Skillpedia
분석 및 스프레드시트37k · #7534

multi-factor

하는 일

이 스킬은 여러 기준으로 종목 그룹을 점수화하고 순위가 높은 종목을 고릅니다. 많은 종목으로 한꺼번에 포트폴리오를 만드는 투자자를 위한 스킬입니다.

사용하는 경우

  • ✓여러 기준을 함께 써서 한 그룹에서 상위 종목을 고르고 싶을 때.
  • ✓모멘텀, 변동성, 거래량을 한꺼번에 비교하고 싶을 때.
  • ✓상위 종목들로 동일 비중 포트폴리오를 만들고 싶은 경우.

스킬 링크

https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/multi-factor/SKILL.md

복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.

사용 방법

가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.

바로 붙여넣을 수 있는 메시지

Use this skill to help me: https://github.com/HKUDS/Vibe-Trading/blob/main/agent/src/skills/multi-factor/SKILL.md Read the SKILL.md file at that link and follow its instructions for my task.
AI가 이런 스킬을 알아서 찾아 쓰길 원하시나요?무료 Skillpedia MCP를 설치하세요. 한 줄이면 작업마다 스킬 15,000+개 중에서 검색합니다.1분 만에 설치 →

AI에게 요청하는 예시

“이 50개 종목을 모멘텀과 변동성으로 순위를 매기고, 상위 10개를 보여 주세요.”

매주 새 스킬 5개. 읽는 데 1분.

작동 방식

에이전트는 각 종목을 팩터별로 점수화하고, 공정하게 비교할 수 있도록 점수를 표준화한 뒤 합산합니다. 점수가 높은 종목들이 동일 비중으로 포트폴리오에 들어갑니다.

기술 내용 (원본 SKILL.md)

작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.

Multi-Factor Cross-Sectional Stock Ranking

Purpose

On the same time cross-section, compute multiple factor values for many stocks, standardize them, combine them into a composite score, and select the top-ranked stocks to build a portfolio.

Signal Logic

  1. Factor calculation: calculate N factors for each stock (such as momentum, value, and quality)
  2. Cross-sectional standardization: standardize each factor on the cross-section with Z-score normalization (subtract mean, divide by standard deviation)
  3. Composite scoring: sum the factors with equal weights (or custom weights) to obtain a composite score
  4. Rank and select: go long the TopN names, with weight = 1/N for each

Built-In Factors

Factor Name Calculation Method Direction
momentum Return over the past N days Positive (higher is better)
reversal Return over the past 5 days Negative (lower is better)
volatility Standard deviation of returns over the past N days Negative (lower is better)
volume_ratio Today's volume / N-day average volume Positive

If extra_fields are available (China A-shares), you can also add:

  • pe_factor: 1/PE (the larger, the cheaper)
  • pb_factor: 1/PB
  • roe_factor: ROE (the larger, the better)

Parameters

Parameter Default Description
momentum_window 20 Momentum lookback window
vol_window 20 Volatility lookback window
top_n 3 Number of selected stocks
rebalance_freq 20 Rebalancing frequency (trading days)

Common Pitfalls

  • Cross-sectional standardization requires at least 3 stocks, otherwise Z-scores are meaningless
  • Keep the previous signal unchanged between rebalance dates (do not rerank every day)
  • Factors have different directions: momentum is positively sorted, volatility is negatively sorted, so directions must be aligned before standardization
  • Portfolio weights must be normalized: each TopN stock gets 1/N, all others get 0

Dependencies

pip install pandas numpy

Signal Convention

  • 1/N = selected into TopN (equal-weight long), 0 = not selected

Zoo Signal Engine (new in 0.1.8)

When the user wants to compose 1-N alphas drawn from the Alpha Zoo (450+ pre-built factors) into a multi-factor strategy, use ZooSignalEngine.from_zoo(...) from zoo_signal_engine.py instead of the old per-symbol example_signal_engine.py. The new engine operates on wide-panel dict[str, pd.DataFrame] inputs (the same shape the registry's Alpha.compute(panel) contract uses), redistributes weights when any alpha fails or is skipped, and supports long-only (top_n), short-only (bottom_n), and long-short (top_n + bottom_n) signal modes. It also exposes a generate(data_map) adapter so it drops straight into the existing run_backtest pipelines.

from src.factors.registry import Registry
from zoo_signal_engine import ZooSignalEngine

registry = Registry()
# Browse candidates with registry.list(theme="momentum") -- see the alpha-zoo skill.
alpha_ids = ["alpha101_001", "alpha101_012", "guotai_191_003"]
engine = ZooSignalEngine.from_zoo(alpha_ids, top_n=10, bottom_n=10, standardize=True)
# Feed into a panel-aware backtest, or via .generate(data_map) into the bundled engines.
signal_panel = engine.compute_signal(panel)  # DataFrame, same shape as panel["close"]

Cross-references:

  • See the alpha-zoo skill for browsing the alpha catalogue, filtering by theme/universe, and inspecting __alpha_meta__ records.
  • example_signal_engine.py is kept for legacy per-symbol workflows that compute factors directly from raw OHLCV; new code should prefer zoo_signal_engine.py so it benefits from the 450+ zoo alphas, registry-level NaN/inf guardrails, and per-alpha skip isolation.
자주 묻는 질문

팩터란 무엇인가요?

최근 수익률이나 가격 변동 폭처럼 종목에서 측정할 수 있는 특성입니다.

가중치를 바꿀 수 있나요?

네. 스킬은 동일 가중이나 팩터별 사용자 지정 가중을 허용합니다.

기본으로 포함된 팩터는 무엇인가요?

모멘텀, 반전, 변동성, 거래량 비율을 포함하며, 데이터가 있으면 가치 팩터도 추가합니다.

상세 정보

작성자의 원본 설명

Multi-factor cross-sectional stock ranking. Combines factor standardization, equal-weight or IC-weighted scoring, and TopN portfolio construction. Suitable for multi-instrument portfolio strategies.

repo: HKUDS/Vibe-Trading

인기도

GitHub 스타
37k
순위
#7534
라이선스
MIT
업데이트
2026. 11. 1.

이 스킬이 유용한가요?

0

로그인 투표하려면 로그인하세요.

댓글

  • …

이 저장소의 다른 스킬

비슷한 스킬