portfolio-risk
Skill4 starsChanged 4 months agoMITView on GitHub
Analyzes portfolio risk and performance metrics. Computes Value at Risk (VaR), Sharpe ratio, Sortino ratio, beta, correlation matrices, drawdown analysis, and position sizing recommendations. Trigger when the user requests risk analysis, portfolio optimization, or performance attribution.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- EodHistoricalData/eodhd-claude-skillstheir own version, first seen Oct 13, 2026
- awslabs/agentcore-samplestheir own version, first seen Oct 13, 2026
- awslabs/amazon-bedrock-agentcore-samplestheir own version, first seen Oct 8, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- awslabs/amazon-bedrock-agentcore-samples★ 3.5ksame name
- awslabs/agentcore-samples★ 3.5ksame name
- EodHistoricalData/eodhd-claude-skills★ 47same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- report-generationSkill
- visualizationSkill
- data-cleaningSkill
- code-review-financeSkill
- doc-generationSkill
- opentdx-engineeringSkill
- gelan-trinity-tradingSkill
- query-skillsSkill
- new-skillSkill
- backtest-strategySkill
- evf-stock-skillSkill
- market-dataSkill
- strategy-developmentSkill
- technical-analysisSkill
- yanchixia-short-termSkill
- yeren-trading-systemSkill
The file
Files
Portfolio Risk
Analyzes portfolio risk and recommends position sizing and diversification.
Real Code Reference
tradinglearn/backtest/backtester.py—Backtester._calculate_performance()computes Sharpe, max drawdown, win rate, total return, CAGRtradinglearn/utils/parameter_optimizer.py—plot_optimization_results()heatmaps: return, Sharpe, drawdown, win ratetradinglearn/pytdx2/backtest.py—BacktestEnginetracks per-trade P&L for risk analysis
Risk Metrics
- VaR: historical simulation, parametric, Monte Carlo
- CVaR (Expected Shortfall): average loss beyond VaR
- Maximum Drawdown: peak-to-trough with recovery duration
- Volatility: annualized std of returns
Performance Metrics
- Sharpe Ratio: (R - Rf) / sigma
- Sortino Ratio: downside-only volatility
- Calmar Ratio: annual return / max drawdown
- Information Ratio: active return / tracking error
Portfolio Analysis
- Correlation matrix between holdings
- Beta to market benchmark
- Position concentration (Herfindahl index)
- Risk parity weights
Usage
from backtest.backtester import Backtester
bt = Backtester(initial_capital=100000.0)
bt.run_backtest(data, MyStrategy, params)
perf = bt.get_performance()
# {'total_return': 0.15, 'annual_return': 0.12, 'sharpe_ratio': 1.2,
# 'max_drawdown': -0.08, 'win_rate': 0.55, 'total_trades': 42}
portfolio = bt.get_portfolio()
# DataFrame with: portfolio_value, position, cash, returnsDoes it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

