multi-factor

Rank stocks by combining normalized technical and fundamental factors into TopN portfolio signals.

30.4k|4.9k|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/HKUDS/Vibe-Trading --skill multi-factor
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: multi-factor
Source: https://github.com/HKUDS/Vibe-Trading/tree/main/agent/src/skills/multi-factor
Command: npx skills add https://github.com/HKUDS/Vibe-Trading --skill multi-factor

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires pandas, numpy, requests.

What problem does it solve?

This Skill solves the challenge of manually identifying high-conviction long candidates across many stocks by computing and blending multiple cross-sectional factors then maintaining stable portfolio weights across rebalance windows.

Core Features & Use Cases

  • Composite Scoring: Calculates momentum, reversal, volatility, and volume ratio, standardizes them via Z-score, and sums them into a unified ranking.
  • TopN Portfolio Signals: Selects the highest-scoring securities, assigns equal long weights, and reuses the previous signal between rebalance dates to avoid churn during a real-world trading cycle.
  • Use Case: Deploy this engine to score China A-share or global holdings, optionally add 1/PE, 1/PB, or ROE when available, and rebalance every 20 trading days to keep exposures fresh yet stable.

Quick Start

Ask the skill to score your cross-sectional stock universe, normalize the factors, and return the TopN equal-weight names.

Frequently Asked Questions about multi-factor

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a cross-sectional stock ranking model using multiple factors?

To build a cross-sectional stock ranking model, you combine normalized technical and fundamental factors like momentum and volatility into a composite score. This process uses Z-score standardization per factor and sums them to produce unified portfolio signals for TopN selection.

What is Z-score standardization and why use it for multi-factor portfolio construction?

Z-score standardization normalizes diverse factors like momentum, reversal, and volume ratio onto a comparable scale. It prevents high-magnitude factors from dominating the composite score, ensuring equal contribution when summing them into a unified cross-sectional ranking signal.

How do I calculate momentum and reversal signals for a stock universe in pandas?

You calculate momentum and reversal signals in pandas by computing historical returns over lookback windows. These technical inputs are then standardized via Z-score and combined with volatility and volume ratios to rank stocks across the cross-sectional universe.

Can I apply equal-weight TopN selection and manage portfolio rebalance frequency with Python?

Yes, you can apply equal-weight TopN selection and manage rebalance frequency in Python. The approach assigns equal long weights to the highest-scoring securities and reuses previous signals between rebalance dates, such as a 20-day cycle, to prevent portfolio churn.

Does this multi-factor ranking approach work for China A-share equities?

Yes, this multi-factor ranking approach works for China A-share equities. You can score cross-sectional holdings using momentum, reversal, volatility, and volume inputs, optionally adding fundamental factors like 1/PE or ROE when available for the universe.

What are the limitations of using equal-weight TopN selection for portfolio signals?

Equal-weight TopN selection limits portfolio signals by ignoring factor magnitude differences, assigning identical weights to all selected stocks. It relies on fixed rebalance intervals like 20 days to maintain stable exposures, which may lag during sudden market reversals or volatility spikes.