Skip to content

Multi-Factor Stock Ranking

Ranks many stocks on several factors and builds a top-N portfolio signal

Stars
37,433
Licence
MIT
Files
3 files

What it does

Teaches the agent a quantitative finance method: on each date, it scores a group of stocks on several factors (such as momentum, volatility, and volume ratio), standardizes those scores so they are comparable, adds them into one composite score, and picks the top-ranked stocks with equal weights. It also includes a newer engine that can use pre-built factors from an Alpha Zoo library and supports long-only, short-only, or long-short signals. It is a trading-signal tool, not a finished trading system.

Great for

  • Quant researchers building multi-stock portfolio backtests
  • Developers who want a ready template for cross-sectional factor ranking in pandas
  • Users who already have price or volume data for many instruments

Skip it if

  • People expecting investment advice or guaranteed returns: the skill only computes rankings from historical data, and backtested results can mislead.
  • Single-stock analysis: the method needs at least 3 stocks on each date to be meaningful.
  • Live trading without review: the code does not place orders, but its output is meant to feed trading decisions, so errors in data or logic can cause real losses.

Try asking

  • “Rank my 50 stocks by 20-day momentum and volatility and pick the top 5 with equal weights”
  • “Build a long-short multi-factor signal from the Alpha Zoo alphas alpha101_001 and alpha101_012, with 10 longs and 10 shorts”
  • “Explain how z-score standardization and factor direction alignment work in my ranking code”
  • “Set up a monthly rebalance backtest of a top-3 equal-weight momentum portfolio”
Step-by-step guide: how to use Multi-Factor Stock RankingInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 3 original files, the MIT licence and an attribution note.

    multi-factor.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip multi-factor.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip multi-factor.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Give the agent clean, aligned price data (same dates and symbols across fields) and state the universe size, since the method needs at least 3 stocks per date.
  • Ask for the rebalance frequency explicitly and check that signals are held between rebalance dates rather than reranked daily.
  • Backtest results ignore costs and survivorship bias unless you ask the agent to model them; validate out-of-sample before relying on any signal.

What's inside

  • example_signal_engine.py
  • SKILL.md
  • zoo_signal_engine.py

Redistributed unmodified from HKUDS/Vibe-Trading under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.