Trading comps that survive scrutiny. Hand a coding agent a ticker and it runs the full 8-step comparable-company analysis — peer screening, multiple alignment, quartiles, implied valuation range — and writes up what the market is actually paying for this kind of business.
The catch most LLM finance workflows hit: the model does the arithmetic in its head and the numbers drift. This skill refuses that. Every median, quartile and implied share price is computed by a unit-tested script. The agent fetches data and interprets; it never multiplies.
**样本数**:4 家 peer
| 倍数 | 可用样本 | 中位数 | 均值 | 25 分位 | 75 分位 | 隐含每股(25/中/75) |
|---|---|---|---|---|---|---|
| EV/Revenue | 4 | 4.05x | 4.2x | 3.83x | 4.42x | 22.41 / 23.81 / 26.16 |
| EV/EBITDA | 4 | 13.8x | 14.18x | 13.32x | 14.65x | 13.49 / 14.03 / 14.98 |
| EV/GrossProfit | 0 | — | — | — | — | 无有效样本 |
| P/E | 4 | 21.6x | 22.03x | 20.77x | 22.85x | 51.94 / 54.0 / 57.12 |
Missing data shows up as N/A and gets skipped, never filled with a plausible-looking guess.
That one rule is the difference between a comps table you can defend and one that quietly lies.
python3 scripts/comps_calc_test.py # verify the math (CI runs this too)
python3 scripts/comps_calc.py --input examples/input.json # run the sampleInput is plain JSON — peer multiples plus the target's forecast metrics:
{
"net_debt": 1200,
"shares": 800,
"target": { "revenue": 5000, "ebitda": 900, "eps": 2.5 },
"peers": [
{"name": "Peer A", "EV/Revenue": 4.2, "EV/EBITDA": 14.1, "P/E": 22.0},
{"name": "Peer B", "EV/Revenue": 3.6, "EV/EBITDA": 12.8, "P/E": 19.5}
]
}Point your agent at SKILL.md and it will gather the peers, fill this in, and run it.
Zero third-party dependencies — Python stdlib only.
- Frame the target and the viewpoint (control vs minority, equity vs EV)
- Screen peers on business model, size and geography — see
references/peer_selection.md - Pull multiples from a real data source
- Align the calendar (LTM / NTM / FY+1) and the currency — see
references/multiples.md - Compute central tendency — median and quartiles, not the mean
- Build the sensitivity range
- Cross-check against DCF
- Conclude, and name the variable that would make you re-underwrite
- EV multiples include net debt; P/E does not. The script keeps the two lanes separate so they never get mixed in the same sentence.
- Negative or missing denominators are dropped, not patched.
- A >20% gap vs. DCF blocks the conclusion. You must reconcile methodology or peer set first.
- Cheap is not cheap.
references/value_trap.mdlists the structural reasons a low multiple is correct.
westock-data— structured A-share / HK / US data with forward consensusakshare-stock,neodata-financial-searchWebSearch, company IR, annual reports as fallback
Anything unavailable is written as N/A. The skill would rather hand you a hole than a number.
| Skill | Question it answers |
|---|---|
| macro-dashboard | Should I be deploying capital at all right now? |
| valuation-comps (here) | Is this cheap or expensive relative to its peers? |
| dcf-quick | What is it worth, what is my downside, how big a position? |
Macro switch → screen → price. Each one is independently useful; together they keep you from sizing a position off a valuation you ran in isolation.
MIT. Analysis is a tool for thinking, not a substitute for it — the decision stays yours.