multi-factor-model

A guide to building a stock-picking model that combines several measurable signals, called factors, such as valuation, growth, profitability, size, momentum, and volatility. It explains how to test those signals and combine them into a score or statistical model.

In plain words
What is it for?
Use it to select candidate factors, test whether they relate to later returns, remove overlapping factors, and build a systematic stock-ranking strategy.
Why use it?
It gives investors a structured way to compare stocks instead of relying on one measure or an unsupported hunch.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/feicoder/skill-factory/multi-factor-model
Any agent
npx skills add FeiCoder/Skill-Factory --skill multi-factor-model
Clone the repo
git clone --depth 1 https://github.com/FeiCoder/Skill-Factory

Made for: Claude Code, Codex.

Per session 65 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,925 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00065 $0.02925
Opus 5 $0.00032 $0.01463
Sonnet 5 $0.00013 $0.00585
Haiku 4.5 $0.00006 $0.00293

Measured 2d ago against content hash f3d1e17027c8, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

multi-factor-model scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

produced_skill/stock-selection/multi-factor-model/SKILL.md · 296 lines

How it starts

The opening of the file, as written. The whole thing — 296 lines — stays where its author put it; the contents beside it link to each section on GitHub.

多因子选股模型

概述

多因子模型是应用最广泛的选股模型之一。其核心思想是:采用一系列因子作为选股标准,满足这些因子的股票则被买入,不满足的则卖出。

多因子模型相对来说比较稳定,因为在不同市场条件下,总有一些因子会发挥作用。

何时使用此技能:

  • 当需要构建系统化的选股策略时
  • 当需要综合多个指标进行选股时
  • 当需要构建长期稳健的Alpha收益时

理论基础

有效市场假说与因子

市场上的投资者(价值投资者、投机者、短线交易者)都会根据某些因子来判断股票的涨跌。当有一群交易者同时采用某个因子时,就会造成该因子有效。

例如:当很多投资者认为低PE的价值型股票是好的投资标时,他们纷纷买入低PE股票,会使得该股票出现上涨或超越大市。这样就使得低PE因子的有效性得到体现。

两种判断方法

方法 原理 优点 缺点
打分法 根据各个因子大小对股票打分,按权重加权得到总分 相对稳健,不易受极端值影响 不能及时调整敏感性
回归法 用过去收益率对因子回归,预测未来收益 能及时调整敏感性,不同股票敏感性可不同 易受极端值影响

推荐:初学者使用打分法,熟练后可尝试回归法


模型构建五步法

第一步:候选因子选取

候选因子类型及示例:

类别 因子 说明
估值因子 PE、PB、PS 市盈率、市净率、市销率
成长因子 净利润增长率、营收增长率、EPS增长率 盈利增长速度
盈利因子 ROE、ROA、毛利率、净利率 盈利能力
规模因子 总市值、流通市值 公司大小
动量因子 20日涨跌幅、60日涨跌幅 过去价格表现
波动因子 日收益率标准差 价格波动程度
预期因子 分析师一致预期、盈利预测 市场预期
宏观因子 GDP增速、M2 经济环境

选取原则

  • 因子必须有经济意义
  • 因子必须具备显著的预测能力
  • 更多和更有效的因子能增强信息捕获能力

第二步:因子有效性检验

检验方法:排序法

Step 1: 在每个月初计算每只个股的各因子指标
Step 2: 按因子大小从小到大排序,平均分为n个组合(建议5个)
Step 3: 持有至月末,下月初重新构建组合
Step 4: 重复到模型形成期末

有效性判断标准(三个条件):

  1. 排序关系:组合因子大小与收益应具有较大相关性

    • 因子越小收益越高:x₁ < x₂ < ... < xₙ 应导致 r₁ > r₂ > ... > rₙ
    • 或因子越大收益越高:反向关系
  2. 超额收益:极端组合应有显著超额收益

    • max(Ri - Rb) > 最小超额收益阈值
    • min(Ri - Rb) < 最大负超额收益阈值
  3. 胜率:不同市场环境下高收益组合跑赢基准概率高

关键指标

指标 含义 合格标准
年化复合收益 组合的实际收益 最高组合 > 最低组合
超额收益 相对于基准的收益 > 5%
跑赢概率 跑赢基准的月份占比 > 60%

第三步:冗余因子剔除

问题:不同因子可能由于内在驱动因素相同,所选出的组合高度一致,需要剔除冗余因子。

剔除步骤:

Step 1: 对不同因子下的n个组合打分(收益越大分值越高)
Step 2: 按月计算个股因子得分间的相关性矩阵
Step 3: 计算整个样本期内相关性矩阵的平均值
Step 4: 设定阈值(通常0.5),超过阈值的因子只保留有效性最强的

案例:盈利收益率与PEG相关性0.89 → 只保留盈利收益率


第四步:综合评分模型

构建方法:

Step 1: 选取去除冗余后的有效因子
Step 2: 每月初计算每只股票的各因子得分
Step 3: 按权重加权求平均分
Step 4: 按总分排序,选取排名靠前的股票

可选参数

  • 选取得分最高的前20%股票
  • 或选取得分最高的50~100只股票

注意

  • ST/PT股票应剔除
  • 如因子无法取值,该因子不参与平均

Read the full file on GitHub · 296 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 296 lines · 65 tokens per session scan A f3d1e17027c8

Subscribe to this mod's changes

multi-factor-model is a skill published in the GitHub repository FeiCoder/Skill-Factory (10 stars, last pushed 6mo ago), licensed MIT. It adds 65 tokens to every session and 2,925 once invoked, about $0.0003 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

systematic-debugging

Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes.

obra/superpowers · 21 tokens

next-cache-components-adoption

Turn on Cache Components in a Next.js app and resolve the blocking routes it surfaces. Use when the user wants to enable, adopt, or migrate to Cache Components, flip the cacheComponents flag, work through a flood of blocking-prerender / instant validation errors, run the cache-components-instant-false codemod, or…

vercel/next.js · 95 tokens

babysit-pr

Babysit a GitHub pull request after creation by continuously polling review comments, CI checks/workflow runs, and mergeability state until the PR is merged/closed or user help is required. Diagnose failures, retry likely flaky failures up to 3 times, auto-fix/push branch-related issues when appropriate, and keep…

openai/codex · 114 tokens

imagegen

Generate or edit raster images when the task benefits from AI-created bitmap visuals such as photos, illustrations, textures, sprites, mockups, or transparent-background cutouts. Use when Codex should create a brand-new image, transform an existing image, or derive visual variants from references, and the output…

openai/codex · 113 tokens

cpu-profile-analysis

Analyze V8/Chrome CPU profiles (.cpuprofile) and DevTools trace files (Trace-.json). Use when: profiling performance, investigating slow functions, comparing code paths, finding bottlenecks, analyzing timeToRequest, understanding call trees from sampling profiler data, analyzing layout/paint/rendering, investigating…

microsoft/vscode · 71 tokens

next-cache-components-optimizer

Drive a Next.js route to instant navigation by setting up an agentic loop, under Cache Components / PPR, on initial load (hard navigation) and client-side navigation (soft navigation). Encode the goal as a failing @next/playwright instant() e2e and work it to green, one verified route at a time; the shipped test then…

vercel/next.js · 170 tokens