— No reviews yet
0 installs
12 views
0.0% view→install
Install
$ agentstack add skill-qunyou-agent-finance-skills-portfolio-risk ✓ scanned · ✓ verified — works with Claude Code, Cursor, and more.
Security review
✓ PassedNo issues found. Passed automated security review. · v0.1.0 How review works →
- ✓ Prompt-injection patterns
- ✓ Secret / credential exfiltration
- ✓ Dangerous shell & filesystem operations
- ✓ Untrusted network calls
- ✓ Known-malicious package signatures
What it can access
- ✓ Network access No
- ✓ Filesystem access No
- ✓ Shell / process execution No
- ✓ Environment & secrets No
- ✓ Dynamic code execution No
From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.
Are you the author of Portfolio Risk? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claimAbout
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, returns
Source & license
This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.
- Author: qunyou-agent
- Source: qunyou-agent/finance-skills
- License: MIT
Install and usage instructions live in the source repository linked above.
Reviews
No reviews yet — be the first.
Write a review
Versions
- v0.1.0 Imported from the upstream source.