/quant-skills:quantitative-financefrom quant-skills
Guides rigorous quantitative finance and systematic trading work: backtest design, signal testing, time-series statistics, portfolio construction, risk measures, position sizing, execution analysis, and performance evaluation. Emphasizes avoiding look-ahead, survivorship, and overfitting.
Ships in quant-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Results in this field are wrong by default, and every common mistake errs in the flattering direction: look-ahead, survivorship, missing costs and picking the best of many tries all raise the Sharpe ratio. So the working stance is the reverse of most engineering: a good result is a bug report until it has been explained.
State every result as net of costs, out of sample, on point-in-time data. When one of those three does not hold, say which, next to the number.
Ask them in this order; the early ones invalidate everything after them.
| # | Question | Typical failure | Check |
|---|---|---|---|
| 1 | Could each input have been known when the trade was placed? | signal and return on the same bar; restated fundamentals; full-sample scaling | lag everything; scramble the future and confirm the past does not move |
| 2 | Is the universe the one that existed then? | today's index members applied to history | include delisted names with their final returns |
| 3 | What did trading cost? | zero cost, or commission only | spread + impact + commission, plus borrow and financing for shorts and leverage |
| 4 | How many versions were tried? | best of 50 variants reported as the result | count trials, apply a deflated Sharpe, keep one untouched holdout |
| 5 | How much independent evidence is there? | overlapping returns counted as separate; one regime | t-stat = Sharpe x sqrt(years); compare sub-periods |
| Topic | Default | Why |
|---|---|---|
| Returns | simple returns across assets, log returns across time | portfolio return is a weighted sum of simple returns; log returns add over time |
| Sharpe | arithmetic mean over standard deviation, times sqrt(periods) | using the compounded return in the numerator understates it and mixes definitions |
| Excess return | subtract the cash rate from any return that includes interest on cash or collateral; trading P&L of a dollar-neutral book that excludes that interest is already an excess return | interest earned on collateral is not skill |
| Annualizing | sqrt(252) only when daily returns are close to uncorrelated | autocorrelation makes sqrt-time scaling wrong in either direction |
| Execution | a signal from the close of day t trades no earlier than the next bar | same-bar fills are the most common look-ahead |
| Volatility | exponentially weighted, short half-life for variance | volatility clusters; flat windows react late |
| Quantity | Rule | Use |
|---|---|---|
| Significance of a Sharpe | t = Sharpe x sqrt(years) | a Sharpe of 1 needs about 4 years to reach t = 2 |
| Best of N random tries | expected max Sharpe is about 2.2 standard errors at N = 50 and 2.5 at N = 100 | 50 tries on 2 years of data gives about 1.5 by luck alone |
| Fundamental law | IR is about IC x sqrt(breadth) | small edge, many independent bets |
| Score to forecast | alpha = IC x volatility x z-score | puts signals and costs in the same units |
| Half-life | -ln 2 / ln(1 + b), b from regressing the change on the lagged level | holding period for a mean-reverting spread |
| Kelly | f = mu / sigma^2, then trade a quarter to a half of it | mu is estimated, and full Kelly on an overestimate is ruinous |
| Volatility target | weight = target vol / forecast vol, capped | keeps risk steady through regimes |
| Impact | cost is about Y x daily vol x sqrt(order / daily volume) | doubling size raises cost per share by about 41% |
| Pairs screening | 100 stocks make 4,950 pairs; 5% of them pass a cointegration test by chance | require an economic link and out-of-sample stability |
# Same-bar execution: the weight uses the close it is about to earn
pnl = (weights * returns).sum(axis=1) # wrong
pnl = (weights.shift(1) * returns).sum(axis=1) # needs a fill at the close of t; shift(2) if the signal uses that close
# Full-sample scaling: every row sees the future mean and std
z = (x - x.mean()) / x.std() # wrong
z = (x - x.expanding(60).mean()) / x.expanding(60).std() # only the past
# Costs: turnover must be charged on the positions actually held
net = gross - held.diff().abs().sum(axis=1) * cost_bps / 1e4
# Max-Sharpe on sample means is an error maximizer: it buys whatever was luckiest.
# Use forecasts shrunk toward zero or implied returns, and a shrunk or factor covariance.
Read the one that matches the task; each has working code.
| File | Covers |
|---|---|
references/backtesting.md | weight-based backtest with delay and costs, walk-forward splits, performance metrics, Sharpe haircut for multiple trials |
references/statistics.md | stationarity, cointegration and pairs, half-life, GARCH volatility, factor regressions with robust errors |
references/portfolio-and-risk.md | covariance shrinkage, mean-variance with constraints, risk parity, Black-Litterman, VaR and expected shortfall, Kelly sizing |
references/execution.md | implementation shortfall, impact model, TWAP and VWAP schedules, order book measures, transaction cost analysis |
hedge-fund-blueprint: the whole platform in build order, with a gate per build.senior-quantitative-researcher, senior-quantitative-developer,
senior-systematic-trader, senior-quantitative-trader: role playbooks.machine-learning: model training and evaluation; the leakage rules there apply
twice over to financial data.Nothing here is investment advice. These are methods for testing ideas honestly.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
9 skills in this plugin
/hedge-fund-blueprintUse when building, planning, reviewing or extending the platform of a systematic (quant) hedge fund or trading operation as a whole - point-in-time data store, backtester, factor risk model, signals, portfolio optimizer, execution and order management, reconciliation, P&L attribution - or when deciding what to build first, which stack to start with, or whether one of those pieces is finished. Triggers - "build a hedge fund / quant fund / trading system from scratch", "what should I build next", research-to-production pipeline, alpha platform architecture, "is my backtester / risk model / optimizer good enough", trade lifecycle from decision to settlement, how the parts of a fund fit together. Use it even when only one piece is named but the user is clearly assembling the full loop./machine-learningUse when building, training, evaluating, debugging or deploying a machine learning model - tabular models with scikit-learn, XGBoost, LightGBM or CatBoost, deep learning with PyTorch, feature engineering, train/validation/test splitting, cross-validation, choosing metrics, class imbalance, hyperparameter tuning, overfitting, data leakage, probability calibration, model serving, drift monitoring. Triggers - "train a model to predict", "which model should I use", "validation score is great but production is bad", "is this data leakage", "loss is not decreasing", "tune hyperparameters", "imbalanced classes", "deploy this model", "the model got worse over time".npx claudepluginhub ricko12vpl/claude-code-skills --plugin quant-skillsOther plugins' skills for the same job