Strategy Performance Report
tradesdontlie/tradingview-mcp
Builds a performance report for a backtested Pine Script strategy from TradingView data, covering metrics, trades, the equity curve and improvement ideas.
Measures portfolio and backtest risk with VaR, CVaR, maximum drawdown, Monte Carlo simulation, tail modeling and stress tests, using one tested risk module.
$ npx skills add HKUDS/Vibe-Trading --skill risk-analysis -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install HKUDS/Vibe-Trading risk-analysis --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git skills-src && mkdir -p .claude/skills && cp -r skills-src/agent/src/skills/risk-analysis .claude/skills/risk-analysis && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "risk-analysis" agent skill from https://github.com/HKUDS/Vibe-Trading/tree/main/agent/src/skills/risk-analysis into .claude/skills/risk-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "risk-analysis", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/HKUDS/Vibe-Trading/tree/main/agent/src/skills/risk-analysisType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add HKUDS/Vibe-Trading --skill risk-analysis -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install HKUDS/Vibe-Trading risk-analysis --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git skills-src && mkdir -p .agents/skills && cp -r skills-src/agent/src/skills/risk-analysis .agents/skills/risk-analysis && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "risk-analysis" agent skill from https://github.com/HKUDS/Vibe-Trading/tree/main/agent/src/skills/risk-analysis into .agents/skills/risk-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "risk-analysis", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add HKUDS/Vibe-Trading --skill risk-analysis -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install HKUDS/Vibe-Trading risk-analysis --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/agent/src/skills/risk-analysis .cursor/skills/risk-analysis && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "risk-analysis" agent skill from https://github.com/HKUDS/Vibe-Trading/tree/main/agent/src/skills/risk-analysis into .cursor/skills/risk-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "risk-analysis", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/HKUDS/Vibe-Trading.git --path agent/src/skills/risk-analysis--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add HKUDS/Vibe-Trading --skill risk-analysis -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install HKUDS/Vibe-Trading risk-analysis --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/agent/src/skills/risk-analysis .gemini/skills/risk-analysis && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "risk-analysis" agent skill from https://github.com/HKUDS/Vibe-Trading/tree/main/agent/src/skills/risk-analysis into .gemini/skills/risk-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "risk-analysis", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install HKUDS/Vibe-Trading risk-analysisInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add HKUDS/Vibe-Trading --skill risk-analysis -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git skills-src && mkdir -p .github/skills && cp -r skills-src/agent/src/skills/risk-analysis .github/skills/risk-analysis && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "risk-analysis" agent skill from https://github.com/HKUDS/Vibe-Trading/tree/main/agent/src/skills/risk-analysis into .github/skills/risk-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "risk-analysis", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add HKUDS/Vibe-Trading --skill risk-analysis -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install HKUDS/Vibe-Trading risk-analysis --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/HKUDS/Vibe-Trading.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/agent/src/skills/risk-analysis .opencode/skills/risk-analysis && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "risk-analysis" agent skill from https://github.com/HKUDS/Vibe-Trading/tree/main/agent/src/skills/risk-analysis into .opencode/skills/risk-analysis/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "risk-analysis", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
risk-analysisMeasures portfolio and backtest risk with VaR, CVaR, maximum drawdown, Monte Carlo simulation, tail modeling and stress tests, using one tested risk module.
This skill sets out how to measure the downside of a backtest or an asset allocation: value at risk, conditional VaR, maximum drawdown, Monte Carlo price paths, extreme-value fitting of the tail and scenario stress tests. The calculations live in a single tested module, `src/quantlib/risk.py`, and the agent is told to call its functions rather than rewrite the formulas.
A large part of the page is a sign convention. Every loss is reported as a positive number, returns keep their natural sign and carry a `_return` suffix, and a CVaR should never come out below the VaR from the same sample. Values are deliberately not clipped, so a tail with no actual losses shows up as a negative loss. The VaR section compares historical simulation with the parametric normal method, and the excerpt ends shortly after that.
4 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit e532650. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
No scripts in the folder and no shell commands in SKILL.md (its code samples are python and markdown).
From the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Risk Measurement and Stress Testing loads about 3.8k tokens when it runs. Until then it costs about 46 tokens; SKILL.md has 1,546 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from HKUDS/Vibe-Trading at commit e532650, republished under its MIT licence (© HKUDS). 1,546 words, ~3,801 tokens.
.claude/skills/risk-analysis/SKILL.md (or your agent's skills folder).Systematic risk-measurement methodology covering VaR/CVaR calculation, Monte Carlo simulation, stress-test design, and tail-risk analysis. It provides risk evaluation for backtest results and risk-control constraints for asset allocation.
The measures below are implemented once, with tests, in src/quantlib/risk.py. Call them; do not retype the formulas, because a hand-retyped VaR is where the sign convention silently flips.
from src.quantlib.risk import (
historical_var, parametric_var, historical_cvar,
max_drawdown_analysis, monte_carlo_gbm, analyze_mc_results, fit_gpd_tail,
)A loss is a positive number, uniformly, across every function in the module:
| Value | Reads as |
|---|---|
historical_var(...) == 0.028 | a 2.8% loss |
historical_cvar(...) == 0.042 | a 4.2% average loss in the tail |
max_drawdown_analysis(...)["max_drawdown"] == 0.325 | a 32.5% peak-to-trough decline |
analyze_mc_results(...)["var"] == 0.224 | a 22.4% loss |
Quantities that are returns rather than losses keep their natural sign and are named *_return (mean_return, worst_5pct_return, best_5pct_return), so a bad outcome there is negative. Report VaR to the user with the sign the user expects, but never re-derive it — flip it at the presentation layer only.
cvar >= var holds by construction whenever both come from the same sample at the same confidence level. If you ever compute a CVaR below its VaR, the tail mask is wrong.
This is not cvar >= var >= 0. The magnitudes are never clipped, so a sample whose tail contains no actual loss reports a negative loss — a gain. That is deliberate and informative; do not assert non-negativity on a VaR and do not clip it, or you destroy the distinction between "small loss" and "no loss at all".
Definition: the maximum expected loss over a given horizon at a specified confidence level.
| Method | Formula / Steps | Advantages | Disadvantages |
|---|---|---|---|
| Historical simulation | Sort historical returns and take the quantile | No distribution assumption | Depends on historical samples |
| Parametric (normal) | VaR = μ - z_α × σ | Easy to compute | Assumes a normal distribution |
| Monte Carlo | Simulate N paths and take the quantile | Flexible | Computationally intensive |
Reads the loss straight off the sorted sample, so it inherits whatever fat tails the history actually had. horizon scales by the square-root-of-time rule, which is only valid under i.i.d. returns.
historical_var(returns, confidence=0.95) # 1-day 95% VaR
historical_var(returns, confidence=0.99, horizon=10) # 10-day 99% VaRThe quantile is a non-interpolating lower order statistic: element ceil((1 - confidence) * n) - 1 of the ascending-sorted returns, negated. The result is therefore always a return that was actually observed, never a blend of two neighbours.
parametric_var(returns, confidence=0.95)Fits mu and the sample sigma (ddof=1) and returns -(mu + z*sigma) with z = norm.ppf(1 - confidence). Needs at least 2 observations.
Do not assume the parametric figure is the lower one. The direction of the gap depends on the confidence level. A fat tail inflates the fitted sigma, which pushes the normal quantile outward at moderate confidence, where the empirical quantile is still sitting in the well-behaved body. Measured over 300 t(4) samples of 750 daily returns:
| Confidence | Parametric reads above historical |
|---|---|
| 90% | 100% of samples |
| 95% | 92.7% |
| 97.5% | 40.3% |
| 99% | 5.3% |
So the familiar "parametric understates risk" result only appears at 99% and deeper. At the 95% default it is normally the higher of the two, and that is not a sign your code is wrong. Quote both at 99% when the point is to expose the tail.
Definition: the average loss beyond the VaR threshold, more conservative than VaR.
historical_cvar(returns, confidence=0.95)
historical_cvar(returns, confidence=0.99, horizon=10)Averages the VaR order statistic together with everything worse than it (inclusive), which is the standard expected shortfall and is what makes cvar >= var structural rather than incidental.
VaR vs CVaR comparison:
| Metric | VaR(95%) | CVaR(95%) | Meaning |
|---|---|---|---|
| Typical value | 2.1% | 3.4% | CVaR is usually 1.3-1.8x VaR |
| Subadditivity | Not satisfied | Satisfied | CVaR can be used for portfolio risk decomposition |
| Regulation | Basel II | Basel III | Regulatory trend is shifting toward CVaR |
dd = max_drawdown_analysis(equity) # equity = a strictly positive net-value Series
dd["max_drawdown"] # 0.325 -> fell 32.5% below its running peak (POSITIVE)
dd["peak_date"], dd["trough_date"], dd["recovery_date"]
dd["recovered"] # False when the series ends still underwaterFull return keys: max_drawdown, peak_date, trough_date, recovery_date, recovered, peak_to_trough_periods, trough_to_recovery_periods, underwater_days, recovery_days.
recovery_date is None and recovered is False if it never happens.underwater_days / recovery_days are calendar days and require a DatetimeIndex; on any other index they come back None and you should use the *_periods counts, which are always populated.paths = monte_carlo_gbm(
s0=100.0, mu=0.10, sigma=0.20, # mu/sigma are ANNUALISED
n_steps=252, n_paths=10_000,
seed=42, # keyword-only; required for a reproducible run
)
paths.shape # (10000, 253) -- n_steps + 1 columns
paths[:, 0] # exactly s0 on every pathAlways pass seed. It is keyword-only so it cannot be supplied by accident, and leaving it None draws fresh OS entropy — the run is then unreproducible and the numbers in your report cannot be regenerated. Use steps_per_year if the step is not a 252-day trading day.
Column 0 is the starting price, so paths[:, -1] / paths[:, 0] - 1 is the total return over the whole simulation. Terminal expectation is s0 * exp(mu * n_steps / steps_per_year); the median sits lower, at s0 * exp((mu - 0.5*sigma**2) * T), and that gap is the volatility drag, not a bug.
summary = analyze_mc_results(paths, confidence=0.95)
summary["var"], summary["cvar"] # positive loss magnitudes
summary["mean_return"], summary["prob_loss"]
summary["worst_5pct_return"], summary["best_5pct_return"] # signed returnsvar / cvar are computed with exactly the same order-statistic convention as historical_var / historical_cvar, so a simulated VaR and a historical VaR are directly comparable.
| Scenario | Period | China A-share Drawdown | US Equity Drawdown | BTC Drawdown | 10Y Government Bonds |
|---|---|---|---|---|---|
| 2008 financial crisis | 2008.01-2008.10 | -65% | -50% | N/A | yield ↓ 100bp |
| 2015 China equity crash | 2015.06-2015.08 | -45% | -10% | -20% | yield ↓ 50bp |
| 2018 trade war | 2018.01-2018.12 | -25% | -20% | -80% | yield ↓ 30bp |
| 2020 COVID shock | 2020.01-2020.03 | -15% | -35% | -50% | yield ↓ 80bp |
| 2022 hiking cycle | 2022.01-2022.10 | -20% | -25% | -65% | yield ↑ 200bp |
STRESS_SCENARIOS = {
'rate_shock_up_100bp': {
'equity': -0.10, # equities down 10%
'bond_10y': -0.08, # 10-year bonds down 8%
'bond_2y': -0.02, # short bonds down 2%
'gold': +0.05, # gold up 5%
'btc': -0.15, # BTC down 15%
},
'credit_crisis': {
'equity': -0.25,
'bond_10y': +0.05, # government bonds act as a safe haven
'credit_bond': -0.15,
'gold': +0.10,
'btc': -0.30,
},
'liquidity_dry_up': {
'equity': -0.20,
'bond_10y': -0.05, # when liquidity is poor, everything falls
'gold': -0.05,
'btc': -0.40,
'cash': 0.0,
},
'geopolitical_conflict': {
'equity': -0.15,
'bond_10y': +0.03,
'gold': +0.15,
'oil': +0.30,
'btc': -0.20,
},
}portfolio_loss = Σ(weight_i × shock_i × position_i)fit = fit_gpd_tail(returns, threshold_pct=5.0) # keep the worst 5%
fit["shape_xi"] # ξ>0 fat tail, ξ=0 exponential tail, ξ<0 bounded tail
fit["shape_stderr"] # standard error of ξ -- quote ξ with it, never alone
fit["scale_sigma"] # in units of loss magnitude
fit["tail_type"] # "fat" | "exponential" | "bounded"
fit["threshold"], fit["n_exceedances"], fit["exceedance_rate"]Exceedances are non-negative by construction (threshold - return, kept only where the return fell below the threshold), so the GPD location is pinned at zero. Letting loc float instead lets the optimiser absorb tail mass into a shifted origin and biases shape_xi.
tail_type is decided against shape_stderr, not against exact zero. A fitted shape_xi is a float and is never exactly 0.0, so a bare ξ > 0 test would call a genuinely exponential tail "fat" purely on the sign of estimation noise. "fat" therefore means ξ > 2 × shape_stderr, "bounded" means ξ < -2 × shape_stderr, and anything in between is "exponential" — indistinguishable from zero at this sample size. Measured over 200 refits, that 2σ band labels a truly exponential tail "exponential" 96.5% of the time while still catching ξ = +0.40 and ξ = -0.35 100% of the time. A shape_xi of 0.03 with a shape_stderr of 0.02 is not evidence of a fat tail; get more exceedances before you call it one.
Threshold choice is the real judgement call: too high and there is nothing left to fit (fewer than 2 exceedances raises), too low and the EVT limit theorem no longer applies, so the fitted shape stops meaning anything. Check that shape_xi is stable across a few nearby threshold_pct values before quoting it.
| Metric | Calculation | Meaning |
|---|---|---|
| Kurtosis | returns.kurtosis() | >3 indicates fat tails; China A-shares are often in the 4-8 range |
| Skewness | returns.skew() | <0 means left-skewed (large drops are more common than large rallies) |
| Tail ratio | worst 5% / best 5% | >1 means larger downside risk |
| Hill estimator | Tail index | α<2 implies extremely fat tails |
Required:
- Return series (daily or higher frequency) or net-value series
- Portfolio weights (if it is a portfolio)
Optional:
- Benchmark returns (for relative risk analysis)
- Risk budget / constraint settingsNote the sign flip: the module returns losses as positive numbers, while the report below prints them the way a reader expects to see them (max_drawdown 0.325 → -32.5%). Flip once, here at the presentation layer, and never inside a calculation.
## Risk Analysis Report
### Core Risk Metrics
| Metric | Value |
|------|-----|
| Daily volatility | 1.85% |
| Annualized volatility | 29.3% |
| Maximum drawdown | -32.5% (2024.09.15 → 2024.11.20) |
| VaR(95%, 1D) | -2.8% |
| CVaR(95%, 1D) | -4.2% |
| Skewness | -0.45 |
| Kurtosis | 5.2 (fat tail) |
### Stress-Test Results
| Scenario | Portfolio Loss | Stop Triggered |
|------|---------|----------|
| 2020 COVID replay | -18.5% | No |
| Rates +100bp | -12.3% | No |
| Liquidity dry-up | -28.7% | Yes |
### Monte Carlo Simulation (252 days, 10000 paths)
| Statistic | Value |
|------|-----|
| Expected return | +8.2% |
| Loss probability | 35% |
| Worst 5% scenario | -22.4% |
### Risk-Control Recommendations
1. Recommend setting a portfolio stop-loss at -15%
2. Tail risk is elevated; consider allocating 5% to gold as a hedge
3. Correlations rise in stressed markets, so diversification benefits will be discountedseed= to monte_carlo_gbm and quote it in the report, so the numbers can be regenerated; use at least 10,000 paths for stabilitymetrics.csv already includes max_drawdown and sharpe; this skill provides deeper analysis© HKUDS, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in agent/src/skills/risk-analysis of HKUDS/Vibe-Trading.
Open the folder on GitHubat commit e532650
Risk Measurement and Stress Testing next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Risk Measurement and Stress Testing this skillHKUDS/Vibe-Trading | 35k | — | ~3.8k | Automated safety check: Pass | MIT | |
| Strategy Performance Reporttradesdontlie/tradingview-mcp | 6.8k | 2 repos | ~591 | Automated safety check: Pass | Custom licence | |
| WorldQuant BRAIN Alpha ResearchQuantML-Research/wq-alpha-research | 405 | — | ~4.9k | Automated safety check: Pass | None | |
| A-Share Daily Reviewqusong0627/QuantMind | 1.7k | — | ~1.9k | Automated safety check: Pass | AGPL-3.0 | |
| QuantMind Training Config Generatorqusong0627/QuantMind | 1.7k | — | ~1.5k | Automated safety check: Pass | AGPL-3.0 | |
| Alpha Desk Investment ResearchJingHao-Leon/dsh-alpha-desk | 181 | — | ~1.3k | Automated safety check: Notes | MIT |
tradesdontlie/tradingview-mcp
Builds a performance report for a backtested Pine Script strategy from TradingView data, covering metrics, trades, the equity curve and improvement ideas.
QuantML-Research/wq-alpha-research
Chinese-language playbook for WorldQuant BRAIN alphas: choose fields, write expressions, backtest, diagnose check failures, tune turnover, submit and build portfolios.
qusong0627/QuantMind
Produces a post-market review report for the China A-share market from local QuantDB data, news sentiment and model signals, ending in a next-day direction call.
qusong0627/QuantMind
Turns a plain-language model training request into a validated QuantMind training config file that can be imported from the Model Training page.
JingHao-Leon/dsh-alpha-desk
Runs an AI investment research desk around the aihf hedge-fund CLI, with research cycles, backtests and iFinD data, under a risk gate and a rule against placing real trades.
pseudo-longinus/quant-buddy-skills
Queries A-share, Hong Kong and US stock quotes, valuation and financial data through the Quant Buddy API, and runs screening, factor calculation and strategy backtests.
HKUDS/Vibe-Trading
Index of Eastmoney's free, no-token market data interfaces for China A-shares and Hong Kong stocks: fund flows, dragon-tiger lists, margin trading, reports and news.
HKUDS/Vibe-Trading
Retrieves public OKX cryptocurrency market data such as spot prices, candlesticks, funding rates and open interest through the OKX V5 REST API, with no authentication.
HKUDS/Vibe-Trading
Fetches U.S. SEC EDGAR data: resolves tickers to CIK numbers, lists recent 10-K, 10-Q and 8-K filings with document URLs, and pulls XBRL financial series.
HKUDS/Vibe-Trading
Predicts whether a mainland China A-share company risks an ST or *ST warning after its next annual report, using financial thresholds and Sina penalty records.
HKUDS/Vibe-Trading
Breaks a structural trend such as AI infrastructure into its physical supply chain and ranks lesser-known listed companies sitting on each bottleneck.
HKUDS/Vibe-Trading
Plans and drafts an eight-part, roughly 120k-word investigative series on one company, built around a strict fact-check pass rather than fast drafting.
Works with
Categories
Measures portfolio and backtest risk with VaR, CVaR, maximum drawdown, Monte Carlo simulation, tail modeling and stress tests, using one tested risk module. This skill sets out how to measure the downside of a backtest or an asset allocation: value at risk, conditional VaR, maximum drawdown, Monte Carlo price paths, extreme-value fitting of the tail and scenario stress tests.py`, and the agent is told to call its functions rather than rewrite the formulas.
Risk Measurement and Stress Testing fits situations like: calculating VaR and CVaR for the returns of a strategy or portfolio; measuring the maximum drawdown of an equity curve; running a Monte Carlo simulation of possible portfolio outcomes; stress testing a portfolio against historical crisis scenarios.
Run `npx skills add HKUDS/Vibe-Trading --skill risk-analysis -a claude-code`. Or copy the skill folder (agent/src/skills/risk-analysis in HKUDS/Vibe-Trading) into .claude/skills/risk-analysis in your project. Claude Code loads it when a task matches its description.
Run `npx skills add HKUDS/Vibe-Trading --skill risk-analysis -a codex`. Or copy the skill folder (agent/src/skills/risk-analysis in HKUDS/Vibe-Trading) into .agents/skills/risk-analysis in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add HKUDS/Vibe-Trading --skill risk-analysis -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/risk-analysis, .gemini/skills/risk-analysis, .github/skills/risk-analysis and .opencode/skills/risk-analysis in your project.
SKILL.md names no scripts, command-line tools or credentials: Risk Measurement and Stress Testing is instructions for the agent only. Our summary lists: Python with the project's `src/quantlib/risk.py` module.
SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Risk Measurement and Stress Testing is published under the MIT licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.8k tokens (SKILL.md is roughly 15k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Risk Measurement and Stress Testing: Strategy Performance Report (tradesdontlie/tradingview-mcp, 6.8k stars), WorldQuant BRAIN Alpha Research (QuantML-Research/wq-alpha-research, 405 stars), A-Share Daily Review (qusong0627/QuantMind, 1.7k stars) and QuantMind Training Config Generator (qusong0627/QuantMind, 1.7k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
HKUDS (a GitHub organization) maintains it in HKUDS/Vibe-Trading, which has 35,043 GitHub stars. The repository holds 89 skills in this directory. The repository was last updated on October 8, 2026.
Source: HKUDS/Vibe-Trading on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.